Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # /etc/init.d/vnc
- #
- ### BEGIN INIT INFO
- # Provides: x11vnc server
- # Required-Start: gdm3
- # Should-Start:
- # Required-Stop:
- # Should-Stop:
- # Default-Start: 5
- # Default-Stop: 0 1 2 6
- # Short-Description:
- # Description: Start or stop vnc server
- ### END INIT INFO
- #INIT SCRIPT VARIABLES
- SERVICE=$(basename $0)
- PIDFILE="/var/run/${SERVICE}.pid"
- BIN="/usr/bin/x11vnc "
- AUTHFILE=$(ps ax | grep auth | awk '/gdm3/ { print $11 }')
- OPT="-display :0 -ncache 10 -noxdamage -many -auth "$AUTHFILE" -nopw -shared -oa /var/log/vnc.log -xkb -bg -verbose "
- CMD=${BIN}${OPT}
- . /lib/lsb/init-functions
- case "$1" in
- start)
- echo -n "Starting ${SERVICE}..."
- ## Start daemon with startproc(8).
- start_daemon ${CMD}
- sleep 2s
- # Remember status and be verbose.
- #rc_status -v
- ;;
- *)
- echo -e "Usage: ${SERVICE} {start}"
- exit 1
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment