X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=gnt-vnc.sh;h=b8c58921d1a99b9322fc631d57fddf7d70a1084f;hb=fa388da7b6c875106b4f67ea8183bb3a0592ede3;hp=1b30fa2e9fb41a15db4e46632ff68aada66542a7;hpb=92ddc939ad7d349c4e6b792bc6b0c0c7a47e511d;p=gnt-info diff --git a/gnt-vnc.sh b/gnt-vnc.sh index 1b30fa2..b8c5892 100755 --- a/gnt-vnc.sh +++ b/gnt-vnc.sh @@ -1,4 +1,15 @@ #!/bin/sh -e -gnt-instance info $1 | grep 'console connection:' | tr -d '()' | tr ':' ' ' | awk '{ print "ssh -L "$6":"$5":"$6" "$8"\nvncviewer localhost:"$10 }' +instance=$1 + +test -z "$instance" && echo "Usage: $0 instance" && exit 1 + +while ! connection=`gnt-instance info $instance | tee /dev/shm/$instance | grep 'console connection:'` ; do + echo "# [$connection]" + read -p "$instance VNC disabled, enable? [YES, abort with CTRL+C now] " no_abort + gnt-instance modify -H vnc_bind_address=127.0.0.1 $instance + #gnt-instance reboot $instance +done + +echo $connection | tr -d '()' | tr ':' ' ' | awk '{ print "ssh -L "$6":"$5":"$6" "$8"\nvncviewer localhost:"$10 }' | sed "s/\.gnt\.ffzg\.hr/.net.ffzg.hr/"