X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=gnt-vnc.sh;h=b8c58921d1a99b9322fc631d57fddf7d70a1084f;hb=fa388da7b6c875106b4f67ea8183bb3a0592ede3;hp=be8237e8431312a40b1b7c89356b20c967fda0b7;hpb=b2ee7c63d8988cd2d287108e576f53b37f1fd2b2;p=gnt-info diff --git a/gnt-vnc.sh b/gnt-vnc.sh index be8237e..b8c5892 100755 --- a/gnt-vnc.sh +++ b/gnt-vnc.sh @@ -1,4 +1,15 @@ #!/bin/sh -e -gnt-instance info $1 | tee /dev/shm/$1 | grep 'console connection:' | tr -d '()' | tr ':' ' ' | awk '{ print "ssh -L "$6":"$5":"$6" "$8"\nvncviewer localhost:"$10 }' | sed "s/\.gnt\.ffzg\.hr/.net.ffzg.hr/" +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/"