Add DB/LVM disk consistency checker and web/checkdisks remctl
[invirt/packages/invirt-remote.git] / host / usr / sbin / invirt-remote
1 #!/bin/sh
2 # invirt-remote TYPE SERVICE [ARGS...]
3 #
4 # We carry out the remctl command proxied to us by the remote-control server.
5
6 TYPE="$1"
7 SERVICE="$2"
8 shift; shift;
9
10 case "$TYPE" in
11     control)
12         # $SERVICE is hostname
13         COMMAND=/usr/sbin/invirt-vmcontrol
14     ;;
15     web)
16         case "$SERVICE" in
17             lvcreate|lvremove|lvrename|lvresize|vgcapacity)
18                 COMMAND=/usr/sbin/invirt-lvm
19             ;;
20             listvms)
21                 COMMAND=/usr/sbin/invirt-listvms
22             ;;
23             availability|avail)
24                 COMMAND=/usr/sbin/invirt-availability
25             ;;
26             vnccert)
27                 COMMAND=/usr/bin/invirt-vnc-getcert
28                 ;;
29             checkdisks)
30                 COMMAND=/usr/sbin/invirt-check-disks
31                 ;;
32             *)
33                 echo "ERROR: invalid subcommand"
34                 exit 34
35                 ;;
36         esac
37     ;;
38     *)
39         echo "ERROR: invalid command"
40         exit 34
41         ;;
42 esac
43
44 $COMMAND "$SERVICE" "$@"