diff options
Diffstat (limited to 'os-plugins/plugins/qemukvm/files/ifdown')
-rw-r--r-- | os-plugins/plugins/qemukvm/files/ifdown | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/os-plugins/plugins/qemukvm/files/ifdown b/os-plugins/plugins/qemukvm/files/ifdown index be6ec913..e741d9ca 100644 --- a/os-plugins/plugins/qemukvm/files/ifdown +++ b/os-plugins/plugins/qemukvm/files/ifdown @@ -13,17 +13,20 @@ # - Script used for network cleanup of qemukvm in stage4 # ----------------------------------------------------------------------------- -# Clean up script +# get VM_ID through tap name +VM_ID=$(echo $1 | grep -oE "0[0-4]$") +QKTMPDIR=/tmp/qemukvm/${USER}/${VM_ID} +touch /tmp/qemukvm/udhcpd.pids +chmod 666 tmp/qemukvm/udhcpd.pids case "$1" in - tap1) - # Bringing down the dhcp server - killall udhcpd 2>/dev/null - #iptables -t nat -D POSTROUTING -o br0 -j MASQUERADE 2>/dev/null + tapnat0*) + # kill udhcpd + cat ${QKTMPDIR}/udhcpd.pid >> /tmp/qemukvm/udhcpd-unused.pid ;; - tap2) - # Bringing down the dhcp server - killall udhcpd 2>/dev/null + taphost0*) + # kill udhcpd + cat ${QKTMPDIR}/udhcpd.pid >> /tmp/qemukvm/udhcpd-unused.pid ;; esac |