X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=experiments%2Finit.d%2Fvncserver;fp=experiments%2Finit.d%2Fvncserver;h=2b6e6dd27d6e850fe259921bfaa6963804828b22;hb=d111a6a576c1dcc0fac6cf8f2f1287feda6cafb5;hp=0000000000000000000000000000000000000000;hpb=6d986a8244de3031a6e6914b06588c21c9836236;p=feisty_meow.git diff --git a/experiments/init.d/vncserver b/experiments/init.d/vncserver new file mode 100755 index 00000000..2b6e6dd2 --- /dev/null +++ b/experiments/init.d/vncserver @@ -0,0 +1,27 @@ +#!/bin/bash +PATH="$PATH:/usr/bin/" +export USER="fred" +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 +