Created
December 20, 2015 07:56
-
-
Save panbanda/6dcdd5ed6cdfb29f285b to your computer and use it in GitHub Desktop.
Starting up a VNC server in the cloud
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH="$PATH:/usr/bin/" | |
export USER="vnc" | |
DISPLAY="1" | |
DEPTH="16" | |
GEOMETRY="1024x768" | |
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}" | |
. /lib/lsb/init-functions | |
case "$1" in | |
start) | |
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}" | |
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}" | |
;; | |
stop) | |
log_action_begin_msg "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}" | |
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}" | |
;; | |
restart) | |
$0 stop | |
$0 start | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment