diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-15 13:10:10 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-15 13:10:10 +0000 |
commit | 36681224a041c8256f2054f62d7b075743c9c1c6 (patch) | |
tree | f908bd3987d49aff62d9c5dad8642c4d77961a8c /main/vde2/vde2.post-down | |
parent | 27ea70e01bb3a594eddcc08280bf20718ad859bd (diff) | |
download | aports-36681224a041c8256f2054f62d7b075743c9c1c6.tar.bz2 aports-36681224a041c8256f2054f62d7b075743c9c1c6.tar.xz |
main/vde2: add support for debian style network config
Diffstat (limited to 'main/vde2/vde2.post-down')
-rw-r--r-- | main/vde2/vde2.post-down | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/main/vde2/vde2.post-down b/main/vde2/vde2.post-down new file mode 100644 index 000000000..be5f5b31d --- /dev/null +++ b/main/vde2/vde2.post-down @@ -0,0 +1,37 @@ +#!/bin/sh + +VDE_SWITCH=/usr/bin/vde_switch +SLIRPVDE=/usr/bin/slirpvde + +# this is not an interesting stanza for us +if [ -z "$IF_VDE2_SWITCH" -a -z "$IF_VDE2_PLUG" -a -z "$IF_VDE2_SLIRP" ]; then + exit 0 +fi + +PIDFILE="/var/run/vde2/$IFACE-plug.pid" +CTLFILE="/var/run/vde2/$IFACE.ctl" +if [ -f $PIDFILE ]; then + start-stop-daemon --stop --quiet --pidfile $PIDFILE + rm -f $PIDFILE +fi + +PIDFILE="/var/run/vde2/$IFACE-slirp.pid" +if [ -f $PIDFILE ]; then + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $SLIRPVDE + rm -f $PIDFILE +fi + +PIDFILE="/var/run/vde2/$IFACE.pid" +CTLDIR="/var/run/vde2/$IFACE.ctl" +if [ -f $PIDFILE ]; then + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $VDE_SWITCH + rm -f $PIDFILE + + # set the tap interface to non-persistant, see #568363 + vde_tunctl -b -d $IFACE 1>/dev/null +fi + +rm -rf $CTLDIR +rm -f $CTLDIR.* |