- #!/bin/bash
- ### BEGIN INIT INFO
- # Provides: vncserver
- # Default-Start: 5
- # Default-Stop:
- PATH=$PATH:/usr/bin
- export USER=wrf
- DISPLAY=1
- DEPTH=24
- GEOMETRY=1152x768
- OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
- #. /lib/lsb/init-functions
- case "$1" in
- start)
- echo "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
- su ${USER} -c "vncserver ${OPTIONS}"
- ;;
- stop)
- echo "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}"
- su ${USER} -c "vncserver -kill :${DISPLAY}"
- ;;
- restart)
- $0 stop
- $0 start
- ;;
- esac
- exit 0
- # To add it to autostart, run update-rc.d vncserver defaults
Raw Paste