From: Dobrica Pavlinusic Date: Wed, 1 Aug 2018 13:19:55 +0000 (+0200) Subject: prompt to enable vnc X-Git-Url: http://git.rot13.org/?p=gnt-info;a=commitdiff_plain;h=2620cc3fa89c58661dcdff60138c48aa136b018a prompt to enable vnc --- 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/"