Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.92 KB | None | 0 0
  1. #!/bin/sh -e
  2. ### BEGIN INIT INFO
  3. # Provides: vncserver
  4. # Required-Start: networking
  5. # Required-Stop:
  6. # Default-Start: S
  7. # Default-Stop: 0 6
  8. ### END INIT INFO
  9. PATH="$PATH:/usr/X11R6/bin/"
  10. # The Username:Group that will run VNC
  11. export USER="pi"
  12. #${RUNAS}
  13. # The display that VNC will use
  14. DISPLAY="1"
  15. # Color depth (between 8 and 32)
  16. DEPTH="16"
  17. # The Desktop geometry to use.
  18. #GEOMETRY=”x”
  19. GEOMETRY="800x600"
  20. #GEOMETRY=”1024×768"
  21. #GEOMETRY=”1280×1024"
  22.  
  23. OPTIONS=":${DISPLAY} -geometry ${GEOMETRY} -depth ${DEPTH}"
  24.  
  25. . /lib/lsb/init-functions
  26. case "$1" in
  27. start)
  28. log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
  29. su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
  30. ;;
  31. stop)
  32. log_action_begin_msg "Stoping vncserver for user ‘${USER}’ on localhost:${DISPLAY}"
  33. su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
  34. ;;
  35. restart)
  36. echo "need to implement"
  37. ;;
  38. esac
  39. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement