Advertisement
Guest User

vncserver

a guest
Dec 25th, 2012
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #!/bin/sh -e
  2. ### BEGIN INIT INFO
  3. # Provides: vncserver
  4. # Required-Start: networking
  5. # Default-Start: S
  6. # Default-Stop: 0 6
  7. ### END INIT INFO
  8.  
  9. PATH="$PATH:/usr/X11R6/bin/"
  10.  
  11. # The Username:Group that will run VNC
  12. export USER="root"
  13. #${RUNAS}
  14.  
  15. # The display that VNC will use
  16. DISPLAY="1"
  17.  
  18. # Color depth (between 8 and 32)
  19. DEPTH="16"
  20.  
  21. # The Desktop geometry to use.
  22. GEOMETRY="800x600"
  23. #GEOMETRY="1024x768"
  24. #GEOMETRY="1280x1024"
  25.  
  26. # The name that the VNC Desktop will have.
  27. NAME="my-vnc-server"
  28.  
  29. OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
  30.  
  31. . /lib/lsb/init-functions
  32.  
  33. case "$1" in
  34. start)
  35. log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
  36. su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
  37. ;;
  38.  
  39. stop)
  40. log_action_begin_msg "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}"
  41. su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
  42. ;;
  43.  
  44. restart)
  45. $0 stop
  46. $0 start
  47. ;;
  48. esac
  49.  
  50. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement