source: trunk/packages/sipb-xen-remctl-auto/files/usr/sbin/sipb-xen-remote @ 1168

Last change on this file since 1168 was 1164, checked in by broder, 16 years ago

Implement the newly chosen error code on the host for the case of an
invalid remctl command

  • Property svn:executable set to *
File size: 889 bytes
Line 
1#!/bin/sh
2# sipb-xen-remote TYPE SERVICE [ARGS...]
3#
4# We carry out the remctl command proxied to us by the remote-control server.
5
6TYPE="$1"
7SERVICE="$2"
8shift; shift;
9
10case "$TYPE" in
11    control)
12        # $SERVICE is hostname
13        COMMAND=/usr/sbin/sipb-xen-vmcontrol
14        ;;
15    web)
16        case "$SERVICE" in
17            lvcreate|lvremove|lvrename|lvresize)
18                COMMAND=/usr/sbin/sipb-xen-lvm
19                ;;
20            vmboot)
21                COMMAND=/usr/sbin/sipb-xen-vmcontrol
22                ;;
23            listvms)
24                COMMAND=/usr/sbin/sipb-xen-listvms
25                ;;
26            info)
27                COMMAND=/usr/sbin/xm
28                ;;
29            *)
30                echo "ERROR: invalid subcommand"
31                exit 34
32                ;;
33        esac
34        ;;
35    *)
36        echo "ERROR: invalid command"
37        exit 34
38        ;;
39esac
40
41#echo $COMMAND "$SERVICE" "$@"
42$COMMAND "$SERVICE" "$@"
Note: See TracBrowser for help on using the repository browser.