Advertisement
SH1NU11b1

tightvnc bash

Oct 28th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1.  
  2.  
  3. #!/bin/sh
  4.  
  5. ### BEGIN INIT INFO
  6.  
  7. # Provides: tightvncserver
  8.  
  9. # Required-Start: $local_fs
  10.  
  11. # Required-Stop: $local_fs
  12.  
  13. # Default-Start: 2 3 4 5
  14.  
  15. # Default-Stop: 0 1 6
  16.  
  17. # Short-Description: Start/stop tightvncserver
  18.  
  19. ### END INIT INFO
  20.  
  21.  
  22.  
  23. # More details see:
  24.  
  25. # http://www.penguintutor.com/linux/tightvnc
  26.  
  27.  
  28.  
  29. ### Customize this entry
  30.  
  31. # Set the USER variable to the name of the user to start tightvncserver under
  32.  
  33. export USER='pi'
  34.  
  35. ### End customization required
  36.  
  37.  
  38.  
  39. eval cd ~$USER
  40.  
  41.  
  42.  
  43. case "$1" in
  44.  
  45. start)
  46.  
  47. su $USER -c '/usr/bin/tightvncserver :1'
  48.  
  49. echo "Starting TightVNC server for $USER "
  50.  
  51. ;;
  52.  
  53. stop)
  54.  
  55. pkill Xtightvnc
  56.  
  57. echo "Tightvncserver stopped"
  58.  
  59. ;;
  60.  
  61. *)
  62.  
  63. echo "Usage: /etc/init.d/tightvncserver {start|stop}"
  64.  
  65. exit 1
  66.  
  67. ;;
  68.  
  69. esac
  70.  
  71. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement