summaryrefslogtreecommitdiff
path: root/user/vde2/vde2.post-down
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-07-27 04:21:53 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-07-27 04:21:53 -0500
commitdde7c77d0c5af6b66a6ca69376135558b7c11e8c (patch)
tree65f6ee81e380d85337ad571d0cc44f65535dcadb /user/vde2/vde2.post-down
parent2d93668279aed9d04d659e1c353691e3ff19b58d (diff)
downloadpackages-dde7c77d0c5af6b66a6ca69376135558b7c11e8c.tar.gz
packages-dde7c77d0c5af6b66a6ca69376135558b7c11e8c.tar.bz2
packages-dde7c77d0c5af6b66a6ca69376135558b7c11e8c.tar.xz
packages-dde7c77d0c5af6b66a6ca69376135558b7c11e8c.zip
user/vde2: pull in, fix, modernise
Diffstat (limited to 'user/vde2/vde2.post-down')
-rw-r--r--user/vde2/vde2.post-down37
1 files changed, 37 insertions, 0 deletions
diff --git a/user/vde2/vde2.post-down b/user/vde2/vde2.post-down
new file mode 100644
index 000000000..be5f5b31d
--- /dev/null
+++ b/user/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.*