diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2016-01-27 18:42:41 +0100 |
---|---|---|
committer | Dominique Martinet <dominique.martinet@cea.fr> | 2016-02-02 15:44:08 +0100 |
commit | a4b33a3130bb50bad6e9d794c727f553b164720e (patch) | |
tree | 7f40b5b550de881a6499849325f23842950acadc | |
parent | 7ab0d94ee10d1f8126abd84e4fdd8e087a1ff925 (diff) |
vncviewer simple way...
-rwxr-xr-x | kvm-wrapper.sh | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/kvm-wrapper.sh b/kvm-wrapper.sh index 0234287..b5ab56c 100755 --- a/kvm-wrapper.sh +++ b/kvm-wrapper.sh @@ -1336,21 +1336,7 @@ function kvm_vncviewer_vm () [[ -z "$PORT" ]] && fail_exit "Error: couldn't find vnc port used" if test_nodename "$KVM_CLUSTER_NODE"; then - while - LOCALPORT=$((RANDOM%1000+4000)) - ss -nplt \( sport = :$LOCALPORT \) | grep -q $LOCALPORT - do :; done - - SSH_OPTS="-L $LOCALPORT:localhost:$PORT -N" run_remote "$KVM_CLUSTER_NODE" & - SSHPID=$! - - trap "kill $SSHPID" EXIT - while ! ss -nplt \( sport = :$LOCALPORT \) | grep -q $LOCALPORT; do - sleep 0.1 - done - vncviewer localhost:$LOCALPORT || fail_exit "Error: couldn't start vncviewer" - - kill $SSHPID + vncviewer $KVM_CLUSTER_NODE:$PORT else vncviewer localhost:$PORT fi |