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

Last change on this file since 2094 was 2094, checked in by broder, 15 years ago

Always exec instead of fork&exec on the remctl server so that return
codes get passed on.

  • Property svn:executable set to *
File size: 850 bytes
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 )
[2094]16        exec invirt-remote-listvms "$@" ;;
[1402]17    web/vnccert )
[2094]18        exec invirt-remote-vnccert "$@" ;;
[1665]19    control/help )
[2094]20        exec invirt-remctl-help ;;
[1088]21    control/create|control/install )
[2094]22        exec invirt-remote-create "$SERVICE" "$MACHINE" "$@" ;;
[1161]23    control/listhost|control/list-host )
[2094]24        exec invirt-remote-listhost "$MACHINE" "$@" ;;
[625]25    control/* )
26        # Everything but create must go where the VM is already running.
[2094]27        exec invirt-remote-control "$MACHINE" "$SERVICE" "$@" ;;
[624]28    * )
[2094]29        exec remctl "$(invirt-getconf hosts.0.hostname)" remote "$TYPE" "$SERVICE" "$@" ;;
[624]30esac
Note: See TracBrowser for help on using the repository browser.