SHARE
TWEET

Untitled

a guest Jan 16th, 2012 148 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          x11vnc
  4. # Required-Start:    $local_fs $remote_fs x11-common lightdm
  5. # Required-Stop:     $local_fs $remote_fs
  6. # Default-Start:     2 3 4 5
  7. # Default-Stop:      0 1 6
  8. # Short-Description: X11vnc
  9. # Description:       Debian init script for the X11vnc
  10. ### END INIT INFO
  11. #
  12. # Author:            Alazare619
  13. #
  14. #
  15. set -e
  16.  
  17. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  18. DAEMON=/usr/bin/x11vnc
  19.  
  20. test -x $DAEMON || exit 0
  21.  
  22. if [ -r /etc/default/locale ]; then
  23.   . /etc/default/locale
  24.   export LANG LANGUAGE
  25. fi
  26.  
  27. . /lib/lsb/init-functions
  28.  
  29. # To start lightdm even if it is not the default display manager, change
  30. # HEED_DEFAULT_DISPLAY_MANAGER to "false."
  31. HEED_DEFAULT_DISPLAY_MANAGER=true
  32. DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
  33.  
  34. case "$1" in
  35.   start)
  36.                         log_daemon_msg "Starting X11vnc "x11vnc"
  37.                         start-stop-daemon --start --quiet --pidfile /var/run/x11vnc.pid --make-pidfile --background --exec x11vnc -- -auth /var/run/lightdm/root/:0 -display :0 -forever SAVE -http -unixpw_nis -o /var/log/x11vnc.log -loop
  38.             log_end_msg $?
  39.   ;;
  40.   stop)
  41.         log_daemon_msg "Stopping X11vnc" "x11vnc"
  42.         set +e
  43.         start-stop-daemon --stop --quiet --pidfile /var/run/lightdm.pid \
  44.                 --name lightdm --retry 5
  45.         set -e
  46.         log_end_msg $?
  47.   ;;
  48.   reload)
  49.         log_daemon_msg "Scheduling reload of X11vnc configuration" "x11vnc"
  50.         set +e
  51.         start-stop-daemon --stop --signal USR1 --quiet --pidfile \
  52.                 /var/run/x11vnc.pid --name x11vnc
  53.         set -e
  54.         log_end_msg $?
  55.   ;;
  56.   status)
  57.         status_of_proc -p "$PIDFILE" "$DAEMON" x11vnc && exit 0 || exit $?
  58.   ;;
  59.   restart|force-reload)
  60.         $0 stop
  61.         sleep 1
  62.         $0 start
  63.   ;;
  64.   *)
  65.         echo "Usage: /etc/init.d/x11vnc {start|stop|restart|reload|force-reload|status}"
  66.         exit 1
  67.   ;;
  68. esac
  69.  
  70. exit 0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top