Skip to content

Instantly share code, notes, and snippets.

@biggers biggers/x11vnc.sh
Created Aug 19, 2016

Embed
What would you like to do?
x11vnc service start-up script
#!/bin/sh
VNC_SERVER=/usr/bin/x11vnc
VNC_DISPLAY=:0
LOG_FILE=/tmp/x11vnc-run.log
case "$1" in
start|restart)
killall ${VNC_SERVER}
echo "Starting: ${VNC_SERVER} ${VNC_DISPLAY} on $(uname -n)..."
${VNC_SERVER} -bg -usepw -auth guess -nc -o ${LOG_FILE} -display ${VNC_DISPLAY}
echo $?
;;
stop)
echo "Stopping ${VNC_SERVER} ${VNC_DISPLAY} on $(uname -n)..."
killall ${VNC_SERVER}
echo $?
;;
*)
echo "USAGE: x11vnc.sh [start|stop|restart]"
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.