Added script to set up custom distributions
authorSapan Bhatia <gwsapan@gmail.com>
Tue, 14 Feb 2012 21:48:27 +0000 (16:48 -0500)
committerSapan Bhatia <gwsapan@gmail.com>
Tue, 14 Feb 2012 21:48:27 +0000 (16:48 -0500)
exec/switcheroo [new file with mode: 0644]

diff --git a/exec/switcheroo b/exec/switcheroo
new file mode 100644 (file)
index 0000000..6109c83
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+RDIR="/vservers/$1/rootfs"
+
+if [ ! -d $RDIR ];
+then
+  echo "Please create a root filesystem in the $RDIR directory"
+else
+  vserver $1 stop
+  mv /vservers/$1 /vservers/_$1
+  mv /vservers/_$1/rootfs /vservers/$1
+  vserver $1 start
+fi