Advertisement
Guest User

vnc server daemon

a guest
Dec 5th, 2016
1,130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #! /bin/sh
  2. # /etc/init.d/vncboot
  3.  
  4. ### BEGIN INIT INFO
  5. # Provides: vncboot
  6. # Required-Start: $remote_fs $syslog
  7. # Required-Stop: $remote_fs $syslog
  8. # Default-Start: 2 3 4 5
  9. # Default-Stop: 0 1 6
  10. # Short-Description: Start VNC Server at boot time
  11. # Description: Start VNC Server at boot time.
  12. ### END INIT INFO
  13.  
  14. #USER=parrot
  15. #HOME=/home/parrot
  16. USER=root
  17. HOME=/root
  18.  
  19. DISPLAY=1
  20. export USER HOME
  21.  
  22. case "${1}" in
  23. start)
  24. echo "Starting VNC Server"
  25. #Insert your favoured settings for a VNC session
  26. su - $USER -c "/usr/bin/vnc4server :${DISPLAY} -geometry 1366x768 -depth 24 -pixelformat rgb565"
  27. ;;
  28. stop)
  29. echo "Stopping VNC Server"
  30. /usr/bin/vnc4server -kill :${DISPLAY}
  31. echo
  32. ;;
  33. restart)
  34. ${0} stop
  35. sleep 0.3
  36. ${0} start
  37. ;;
  38. *)
  39. echo "Usage: /etc/init.d/vncboot {start|restart|stop}"
  40. exit 1
  41. ;;
  42. esac
  43.  
  44. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement