Advertisement
martinpavek

run_vnc_server_startup.txt

Aug 28th, 2015
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.85 KB | None | 0 0
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          VNC
  4. # Required-Start:    $local_fs
  5. # Required-Stop:
  6. # Default-Start:     2 3 4 5
  7. # Default-Stop:      0 1 6
  8. # Short-Description: Start or stop the VNC server
  9. ### END INIT INFO
  10.  
  11. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  12.  
  13. eval cd ~pi
  14.  
  15. case "$1" in
  16.   start)
  17.         su pi -c "/usr/bin/vncserver :1 -geometry 1024x728 -depth 24"
  18.         echo "Started VNC server."
  19.         ;;
  20.   stop)
  21.         su pi -c "/usr/bin/vncserver -kill :1"
  22.         echo "Stopped VNC server."
  23.         ;;
  24.   *)
  25.         echo "Usage: vncserver [start|stop]" >&2
  26.         exit 3
  27.         ;;
  28. esac
  29.  
  30. :
  31.  
  32. # tohle zadat postupne v terminalu a pak to odsud smazat
  33.  
  34. # sudo apt-get install tightvncserver
  35.  
  36. # sudo nano /etc/init.d/vncserver
  37.  
  38. # sudo chmod 755 /etc/init.d/vncserver
  39.  
  40. # sudo update-rc.d vncserver defaults
  41.  
  42. # sudo reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement