first rough untested wrapper around sliceip.{vs,lxc}
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 9 Jul 2013 13:26:19 +0000 (15:26 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 9 Jul 2013 13:26:19 +0000 (15:26 +0200)
root-context/exec/sliceip [new file with mode: 0755]

diff --git a/root-context/exec/sliceip b/root-context/exec/sliceip
new file mode 100755 (executable)
index 0000000..3757989
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# relying on nodemanager to create this file
+virtfile=/etc/planetlab/virt
+# if not existent or corrupted, we will assume vs
+virt=vs
+if [ -f $virtfile ] ; then
+    case $(cat $virtfile) in
+       vs) virt=vs;;
+       lxc) virt=lxc;;
+    esac
+fi
+
+# try to avoid depending on PATH
+virt_command=$(dirname $0)/sliceip.$virt
+
+exec $virt_command "$@"