#!/bin/dash
# start a remote x11vnc desktop connection using ssh
PORT=${PORT:-5900}

case "$1" in
	-h|--help|"")
		cat << EOF
ssh to remote host and launch x11vnc.
Usage: PORT=xxxx ${0##*/} ssh-parameters
Default port is $PORT. Start "vncviewer localhost:$PORT" to view.
EOF
	exit
esac

ssh -f -L $PORT:localhost:$PORT "$@" 'x11vnc -localhost -display :0 -auth /var/run/slim.auth'

