Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh -e
- ### BEGIN INIT INFO
- # Provides: vncserver
- # Required-Start: networking
- # Required-Stop:
- # Default-Start: S
- # Default-Stop: 0 6
- ### END INIT INFO
- PATH="$PATH:/usr/X11R6/bin/"
- # The Username:Group that will run VNC
- export USER="pi"
- #${RUNAS}
- # The display that VNC will use
- DISPLAY="1"
- # Color depth (between 8 and 32)
- DEPTH="16"
- # The Desktop geometry to use.
- #GEOMETRY=”x”
- GEOMETRY="800x600"
- #GEOMETRY=”1024×768"
- #GEOMETRY=”1280×1024"
- OPTIONS=":${DISPLAY} -geometry ${GEOMETRY} -depth ${DEPTH}"
- . /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)
- echo "need to implement"
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement