permission mods
[feisty_meow.git] / experiments / vnc / init.d / vncserver.005
1 #!/bin/bash
2 PATH="$PATH:/usr/bin/"
3 export USER="fredhuff"
4 # fredhuff is a different user than my normal user who is logged in on
5 # desktop zero.  this is important for display isolation.
6 DISPLAY="1"
7 DEPTH="16"
8 GEOMETRY="1200x800"
9 XAUTHORITY="/home/$USER/.Xauthority.vnc"
10 OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
11 . /lib/lsb/init-functions
12
13 case "$1" in
14 start)
15 log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
16 su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
17 ;;
18
19 stop)
20 log_action_begin_msg "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}"
21 su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
22 ;;
23
24 restart)
25 $0 stop
26 $0 start
27 ;;
28 esac
29 exit 0
30