stanto

init.d/vnc

May 4th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # /etc/init.d/vnc
  4. #
  5. ### BEGIN INIT INFO
  6. # Provides: x11vnc server
  7. # Required-Start: gdm3
  8. # Should-Start:
  9. # Required-Stop:
  10. # Should-Stop:
  11. # Default-Start: 5
  12. # Default-Stop: 0 1 2 6
  13. # Short-Description:
  14. # Description: Start or stop vnc server
  15. ### END INIT INFO
  16.  
  17. #INIT SCRIPT VARIABLES
  18. SERVICE=$(basename $0)
  19. PIDFILE="/var/run/${SERVICE}.pid"
  20. BIN="/usr/bin/x11vnc "
  21. AUTHFILE=$(ps ax | grep auth | awk '/gdm3/ { print $11 }')
  22. OPT="-display :0 -ncache 10 -noxdamage -many -auth "$AUTHFILE" -nopw -shared -oa /var/log/vnc.log -xkb -bg -verbose "
  23. CMD=${BIN}${OPT}
  24.  
  25.  
  26. . /lib/lsb/init-functions
  27.  
  28.  
  29. case "$1" in
  30. start)
  31. echo -n "Starting ${SERVICE}..."
  32. ## Start daemon with startproc(8).
  33. start_daemon ${CMD}
  34. sleep 2s
  35. # Remember status and be verbose.
  36. #rc_status -v
  37. ;;
  38. *)
  39. echo -e "Usage: ${SERVICE} {start}"
  40. exit 1
  41. ;;
  42. esac
  43. exit 0
Advertisement
Add Comment
Please, Sign In to add comment