summaryrefslogtreecommitdiffstats
path: root/src/os-plugins/plugins/qemukvm/files/ifdown
diff options
context:
space:
mode:
authorSebastian Schmelzer2010-09-02 17:50:49 +0200
committerSebastian Schmelzer2010-09-02 17:50:49 +0200
commit416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5 (patch)
tree4715f7d742fec50931017f38fe6ff0a89d4ceccc /src/os-plugins/plugins/qemukvm/files/ifdown
parentFix for the problem reported on the list (sed filter forgotten for the (diff)
downloadcore-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.tar.gz
core-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.tar.xz
core-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.zip
change dir structure
Diffstat (limited to 'src/os-plugins/plugins/qemukvm/files/ifdown')
-rw-r--r--src/os-plugins/plugins/qemukvm/files/ifdown34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/os-plugins/plugins/qemukvm/files/ifdown b/src/os-plugins/plugins/qemukvm/files/ifdown
new file mode 100644
index 00000000..e741d9ca
--- /dev/null
+++ b/src/os-plugins/plugins/qemukvm/files/ifdown
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Copyright (c) 2009 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# ifdown
+# - Script used for network cleanup of qemukvm in stage4
+# -----------------------------------------------------------------------------
+
+# 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
+ tapnat0*)
+ # kill udhcpd
+ cat ${QKTMPDIR}/udhcpd.pid >> /tmp/qemukvm/udhcpd-unused.pid
+ ;;
+ taphost0*)
+ # kill udhcpd
+ cat ${QKTMPDIR}/udhcpd.pid >> /tmp/qemukvm/udhcpd-unused.pid
+ ;;
+esac
+
+# Produce a clean exit status
+exit 0