Setting tag sliver-openvswitch-2.2.90-1
[sliver-openvswitch.git] / debian / openvswitch-datapath-module-_KVERS_.postinst.modules.in
1 #!/bin/sh
2 # postinst script for #PACKAGE#
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 #DEBHELPER#
9
10 # If the kernel module is already loaded, we have nothing to do here.
11 # A force-reload-kmod should be run manually to use the new kernel module.
12 if [ -e /sys/module/openvswitch ] || [ -e /sys/module/openvswitch_mod ]; then
13     exit 0
14 fi
15
16 # If the kernel module is not loaded, then it is likely because none
17 # was installed before and therefore Open vSwitch couldn't be started.
18 # Try to start it now.
19 #
20 # (Ideally we'd only want to do this if this package corresponds to the
21 # running kernel, but I don't know a reliable way to check.)
22 INIT=/etc/init.d/openvswitch-switch
23 if test -x $INIT; then
24     $INIT start || true
25 fi
26
27 exit 0