source: trunk/packages/invirt-remote/server/usr/sbin/invirt-remote-proxy @ 2275

Last change on this file since 2275 was 2264, checked in by broder, 16 years ago

In invirt-remote:

  • Print errors to stderr on nocreate and nolvm so that the website actually notices.
  • Property svn:executable set to *
File size: 1.3 KB
RevLine 
[830]1#!/bin/bash
[1176]2# invoke as invirt-remote-proxy-$TYPE, with "TYPE" in the remctl sense.
[659]3
[777]4klist -s || kinit -k
[624]5
[620]6TYPE="${0##*-}"
[624]7case "$TYPE" in
8    control )
[659]9        MACHINE="$1"; SERVICE="$2"; shift; shift ;;
[624]10    * )
[659]11        SERVICE="$1"; shift ;;
[620]12esac
[624]13
14case "$TYPE/$SERVICE" in
15    web/listvms )
[2097]16        invirt-remote-listvms "$@" ;;
[1402]17    web/vnccert )
[2097]18        invirt-remote-vnccert "$@" ;;
[2188]19    web/availability )
20        invirt-remote-availability "$@" ;;
[2255]21    web/lvcreate | web/lvremove | web/lvrename | web/lvresize )
[2256]22        if [ -f "/etc/invirt/nolvm" ]; then
[2264]23            echo "LVM operations are temporarily disabled for maintenance, sorry." >&2
[2256]24            exit 2
25        fi
[2255]26        remctl "$(invirt-getconf hosts.0.hostname)" remote "$TYPE" "$SERVICE" "$@" ;;
[1665]27    control/help )
[2097]28        invirt-remctl-help ;;
[1088]29    control/create|control/install )
[2256]30        if [ -f "/etc/invirt/nocreate" ]; then
[2264]31            echo "Booting VMs is temporarily disabled for maintenance, sorry." >&2
[2256]32            exit 2
33        fi
[2097]34        invirt-remote-create "$SERVICE" "$MACHINE" "$@" ;;
[1161]35    control/listhost|control/list-host )
[2097]36        invirt-remote-listhost "$MACHINE" "$@" ;;
[625]37    control/* )
38        # Everything but create must go where the VM is already running.
[2097]39        invirt-remote-control "$MACHINE" "$SERVICE" "$@" ;;
[624]40    * )
[2255]41        echo "ERROR: invalid subcommand"
42        exit 34
43        ;;
[624]44esac
Note: See TracBrowser for help on using the repository browser.