1
1
Fork 0

vncconnect.sh

This commit is contained in:
david 2012-06-14 22:52:53 +02:00
parent d5eab96a7d
commit 8a31cf6326
2 changed files with 14 additions and 9 deletions

14
vncconnect.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
if [ -z $1 ]; then
echo "usage: vncconnect.sh <remote-ip>"
exit 1
else
hostname=$1
ssh $hostname -L 8900/localhost/5901 "sleep 05 && exit" &
sleep 02
vncviewer localhost:8900
echo "killed ssh tunnel to $hostname and ended vnc session"
fi
#end of file

View File

@ -1,9 +0,0 @@
#!/bin/bash
hostname="zion.aec.at"
#xterm -geometry 10x10 -e ssh zion.aec.at -L 8900/localhost/5901 "sleep 05 && exit" &
ssh $hostname -L 8900/localhost/5901 "sleep 05 && exit" &
sleep 02
vncviewer localhost:8900
echo "killed ssh tunnel to $hostname and ended vnc session"