Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- ### BEGIN INIT INFO
- # Provides: x11vnc
- # Required-Start: $local_fs $remote_fs x11-common lightdm
- # Required-Stop: $local_fs $remote_fs
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: X11vnc
- # Description: Debian init script for the X11vnc
- ### END INIT INFO
- #
- # Author: Alazare619
- #
- #
- set -e
- PATH=/sbin:/bin:/usr/sbin:/usr/bin
- DAEMON=/usr/bin/x11vnc
- test -x $DAEMON || exit 0
- if [ -r /etc/default/locale ]; then
- . /etc/default/locale
- export LANG LANGUAGE
- fi
- . /lib/lsb/init-functions
- # To start lightdm even if it is not the default display manager, change
- # HEED_DEFAULT_DISPLAY_MANAGER to "false."
- HEED_DEFAULT_DISPLAY_MANAGER=true
- DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
- case "$1" in
- start)
- log_daemon_msg "Starting X11vnc "x11vnc"
- 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
- log_end_msg $?
- ;;
- stop)
- log_daemon_msg "Stopping X11vnc" "x11vnc"
- set +e
- start-stop-daemon --stop --quiet --pidfile /var/run/lightdm.pid \
- --name lightdm --retry 5
- set -e
- log_end_msg $?
- ;;
- reload)
- log_daemon_msg "Scheduling reload of X11vnc configuration" "x11vnc"
- set +e
- start-stop-daemon --stop --signal USR1 --quiet --pidfile \
- /var/run/x11vnc.pid --name x11vnc
- set -e
- log_end_msg $?
- ;;
- status)
- status_of_proc -p "$PIDFILE" "$DAEMON" x11vnc && exit 0 || exit $?
- ;;
- restart|force-reload)
- $0 stop
- sleep 1
- $0 start
- ;;
- *)
- echo "Usage: /etc/init.d/x11vnc {start|stop|restart|reload|force-reload|status}"
- exit 1
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement