X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=debian%2Fopenvswitch-switch.init;h=36bc20891beeaddff563378007a82c72c63975d0;hb=feb83d8aae83a549e660380820df40ee2490b1d9;hp=44ec67c0bbf3b513e958fd0e765c39b937cd579c;hpb=43bb5f82ec051f335a5c5a8975150ec6352d5d73;p=openvswitch diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index 44ec67c0..36bc2089 100755 --- a/debian/openvswitch-switch.init +++ b/debian/openvswitch-switch.init @@ -25,38 +25,46 @@ (test -x /usr/sbin/ovs-vswitchd && test -x /usr/bin/ovsdb-server) || exit 0 -set -e - test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch ovs_ctl=/usr/share/openvswitch/scripts/ovs-ctl -case $1 in - start) - set $ovs_ctl start --system-id=random - if test X"$FORCE_COREFILES" != X; then - set "$@" --force-oorefiles="$FORCE_COREFILES" - fi - # Allow GRE traffic. - test ! -x /sbin/iptables || /sbin/iptables -I INPUT -p gre -j ACCEPT +start () { + set $ovs_ctl ${1-start} --system-id=random + if test X"$FORCE_COREFILES" != X; then + set "$@" --force-corefiles="$FORCE_COREFILES" + fi + "$@" || exit $? - "$@" - ;; + $ovs_ctl --protocol=gre enable-protocol +} + +stop () { + $ovs_ctl stop +} + +case $1 in + start) + start + ;; stop | force-stop) - $ovs_ctl stop + stop ;; reload | force-reload) # The OVS daemons keep up-to-date. ;; restart) - $0 stop || true - $0 start + stop + start ;; status) $ovs_ctl status ;; + force-reload-kmod) + start force-reload-kmod + ;; *) - echo "Usage: $0 {start|stop|restart|force-reload|status|force-stop}" >&2 + echo "Usage: $0 {start|stop|restart|force-reload|status|force-stop|force-reload-kmod}" >&2 exit 1 ;; esac