]> git.proxmox.com Git - mirror_ovs.git/blame - debian/openvswitch-switch.postinst
Prepare for 2.8.0.
[mirror_ovs.git] / debian / openvswitch-switch.postinst
CommitLineData
064af421
BP
1#!/bin/sh
2# postinst script for openvswitch-switch
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9# * <postinst> `configure' <most-recently-configured-version>
10# * <old-postinst> `abort-upgrade' <new version>
11# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
12# <new-version>
13# * <postinst> `abort-remove'
14# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15# <failed-install-package> <version> `removing'
16# <conflicting-package> <version>
17# for details, see http://www.debian.org/doc/debian-policy/ or
18# the debian-policy package
19
20
21case "$1" in
22 configure)
ff6169cf
GS
23 DEFAULT=/etc/default/openvswitch-switch
24 TEMPLATE=/usr/share/openvswitch/switch/default.template
25 if ! test -e $DEFAULT; then
26 cp $TEMPLATE $DEFAULT
27 else
28 for var in $(awk -F'[ :]' '/^# [_A-Z0-9]+:/{print $2}' $TEMPLATE)
29 do
30 if ! grep $var $DEFAULT >/dev/null 2>&1; then
31 echo >> $DEFAULT
32 sed -n "/$var:/,/$var=/p" $TEMPLATE >> $DEFAULT
33 fi
34 done
35 fi
ef241d1e
GS
36 # Certain versions of upstream Ubuntu's openvswitch packages (which
37 # are forks) may install upstart files which are incompatible
38 # with the packages generated from this repo. Remove them.
39 if [ -e "/etc/init/openvswitch-switch.conf" ]; then
40 rm /etc/init/openvswitch-switch.conf
41 fi
42 if [ -e "/etc/init/openvswitch-force-reload-kmod.conf" ]; then
43 rm /etc/init/openvswitch-force-reload-kmod.conf
44 fi
064af421
BP
45 ;;
46
47 abort-upgrade|abort-remove|abort-deconfigure)
48 ;;
49
50 *)
51 echo "postinst called with unknown argument \`$1'" >&2
52 exit 1
53 ;;
54esac
55
64624b3c
SH
56# Do not fail package installation just because the kernel module
57# is not available.
8a5b3cfd
BP
58OVS_MISSING_KMOD_OK=yes
59export OVS_MISSING_KMOD_OK
64624b3c 60
19cbf2b8
GS
61# force-reload-kmod during upgrade. If a user wants to override this,
62# they can set the variable OVS_FORCE_RELOAD_KMOD=no while installing.
63[ -z "${OVS_FORCE_RELOAD_KMOD}" ] && OVS_FORCE_RELOAD_KMOD=yes || true
64export OVS_FORCE_RELOAD_KMOD
d2bcb6bb 65
064af421
BP
66#DEBHELPER#
67
68exit 0