Merge branch 'master' of feistymeow.org:feisty_meow
[feisty_meow.git] / experiments / vnc / init.d / vncserver.005
diff --git a/experiments/vnc/init.d/vncserver.005 b/experiments/vnc/init.d/vncserver.005
new file mode 100755 (executable)
index 0000000..5cf5e2b
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+PATH="$PATH:/usr/bin/"
+export USER="fredhuff"
+# fredhuff is a different user than my normal user who is logged in on
+# desktop zero.  this is important for display isolation.
+DISPLAY="1"
+DEPTH="16"
+GEOMETRY="1200x800"
+XAUTHORITY="/home/$USER/.Xauthority.vnc"
+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
+