]> git.proxmox.com Git - ovs.git/blame - debian/openvswitch-switch.postinst
Fix ovs-dpctl-top by removing 3 wrong hunks in py3-compat.patch.
[ovs.git] / debian / openvswitch-switch.postinst
CommitLineData
0e43db78
TG
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)
23 mkdir -p /var/lib/openvswitch
24 DEFAULT=/etc/default/openvswitch-switch
25 TEMPLATE=/usr/share/openvswitch/switch/default.template
26 if ! test -e $DEFAULT; then
27 cp $TEMPLATE $DEFAULT
28 else
29 for var in $(awk -F'[ :]' '/^# [_A-Z0-9]+:/{print $2}' $TEMPLATE)
30 do
31 if ! grep $var $DEFAULT >/dev/null 2>&1; then
32 echo >> $DEFAULT
33 sed -n "/$var:/,/$var=/p" $TEMPLATE >> $DEFAULT
34 fi
35 done
36 fi
37
38 # Ensure that /etc/openvswitch/conf.db links to /var/lib/openvswitch,
39 # moving an existing file if there is one.
40 #
41 # Ditto for .conf.db.~lock~.
42 for base in conf.db .conf.db.~lock~; do
43 new=/var/lib/openvswitch/$base
44 old=/etc/openvswitch/$base
45 if test -f $old && test ! -e $new; then
46 mv $old $new
47 fi
48 if test ! -e $old && test ! -h $old; then
49 ln -s $new $old
50 fi
51 done
52 ;;
53
54 abort-upgrade|abort-remove|abort-deconfigure)
55 ;;
56
57 *)
58 echo "postinst called with unknown argument \`$1'" >&2
59 exit 1
60 ;;
61esac
62
63# Do not fail package installation just because the kernel module
64# is not available.
65OVS_MISSING_KMOD_OK=yes
66export OVS_MISSING_KMOD_OK
67
68# force-reload-kmod during upgrade. If a user wants to override this,
69# they can set the variable OVS_FORCE_RELOAD_KMOD=no while installing.
70[ -z "${OVS_FORCE_RELOAD_KMOD}" ] && OVS_FORCE_RELOAD_KMOD=yes || true
71export OVS_FORCE_RELOAD_KMOD
72
73#DEBHELPER#
74
75exit 0