You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
969 B

#!/usr/bin/env bash
set -eu
#set -x
DEBUG=0
synopsis() {
cat << EOF
Usage : `basename $0` [-h] system
EOF
}
help() {
cat << EOF
`basename $0` démarre un client SPICE présentant l'écran du système.
`synopsis`
Remarque : seuls les systèmes KVM avec leur variable KVM_VIEWER fixée à "spice"
proposent un écran SPICE.
-h : affiche cette aide
EOF
}
usage() {
synopsis
exit 1
}
args() {
local opt
while getopts "h" opt; do
case $opt in
h) help; exit 0;;
?) usage;;
esac
done
shift $(($OPTIND - 1))
[ $# -ne 1 ] && usage || :
GUEST_NAME=$1; shift;
}
# Programme principal
export VDN_PATH=$(readlink -f $(dirname $0)/..); . $VDN_PATH/bin/functions.sh
args "$@"
[ $DEBUG = 1 ] && set -x || :
[ $GUEST_NAME != "nested" ] && setGuestVars $GUEST_NAME
GUEST_OWNER=$USER
[ $GUEST_NAME != "nested" ] && loadGuestVars $GUEST_NAME
remote-viewer -t $GUEST_NAME spice+unix://$TMPDIR/vdn-spice-$USER-$GUEST_NAME-socket &