a sipb-xen-remctl-auto file that's been unchecked-in for a while
authorGreg Price <price@mit.edu>
Sun, 29 Jun 2008 03:24:34 +0000 (23:24 -0400)
committerGreg Price <price@mit.edu>
Sun, 29 Jun 2008 03:24:34 +0000 (23:24 -0400)
svn path=/trunk/packages/sipb-xen-remctl-auto/; revision=657

files/usr/sbin/sipb-xen-remote [new file with mode: 0755]

diff --git a/files/usr/sbin/sipb-xen-remote b/files/usr/sbin/sipb-xen-remote
new file mode 100755 (executable)
index 0000000..434009c
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh
+# sipb-xen-remote TYPE SERVICE [ARGS...]
+#
+# We carry out the remctl command proxied to us by the remote-control server.
+
+TYPE="$1"
+SERVICE="$2"
+shift; shift;
+
+case "$TYPE" in
+    control)
+        # $SERVICE is hostname
+        COMMAND=/usr/sbin/sipb-xen-vmcontrol
+       ;;
+    web)
+        case "$SERVICE" in
+            lvcreate|lvremove|lvrename|lvresize)
+                COMMAND=/usr/sbin/sipb-xen-lvm
+               ;;
+            lvcopy)
+                COMMAND=/usr/sbin/sipb-xen-lvcopy
+               ;;
+            vmboot)
+                COMMAND=/usr/sbin/sipb-xen-vmcontrol
+               ;;
+            install)
+                COMMAND=/usr/sbin/sipb-xen-install
+               ;;
+            register|moveregister|unregister|remctl-moira-update)
+                COMMAND=/usr/sbin/sipb-xen-remctl-update
+               ;;
+            listvms)
+                COMMAND=/usr/sbin/sipb-xen-listvms
+               ;;
+           info)
+               COMMAND=/usr/sbin/xm
+               ;;
+            *)
+                echo "ERROR: invalid subcommand"
+                exit 1
+                ;;
+        esac
+       ;;
+    *)
+        echo "ERROR: invalid command"
+        exit 1
+        ;;
+esac
+
+#echo $COMMAND "$SERVICE" "$@"
+$COMMAND "$SERVICE" "$@"