Skip to content

Instantly share code, notes, and snippets.

@biggers
Created August 19, 2016 14:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biggers/be3fe912391ed56e511d675f75725cff to your computer and use it in GitHub Desktop.
Save biggers/be3fe912391ed56e511d675f75725cff to your computer and use it in GitHub Desktop.
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