Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.55 KB | None | 0 0
  1. ### BEGIN INIT INFO
  2. # Provides: vncserver
  3. # Required-Start: networking
  4. # Required-Stop:
  5. # Default-Start: 2 3 4 5
  6. # Default-Stop: 0 1 6
  7. # Short-Description: Starts VNC
  8. # Description:
  9. ### END INIT INFO
  10.  
  11. export USER='pi'
  12.  
  13. eval cd ~$USER
  14.  
  15. # Check state
  16. case "$1" in
  17.   start)
  18.     su $USER -c '/usr/bin/vncserver :1 -geometry 1280x720 -depth 24'
  19.     echo "Starting vncserver for $USER"
  20.   ;;
  21.   stop)
  22.     pkill Xtightvnc
  23.     echo "vncserver stopped"
  24.   ;;
  25.   *)
  26.     echo "Usage: /etc/init.d/vncserver {start|stop}"
  27.     exit 1
  28.   ;;
  29. esac
  30.  
  31. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement