wok view x11vnc/stuff/x11vnc @ rev 17880

Up x11vnc (0.9.13)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Mar 30 12:09:11 2015 +0200 (2015-03-30)
parents d029ffb67ea4
children 7f188676b59c
line source
1 #!/bin/sh
2 # /etc/init.d/x11vnc: Start, stop and restart web server on SliTaz,
3 # at boot time or with the command line. Daemons options are configured
4 # with /etc/daemons.conf
5 #
6 . /etc/init.d/rc.functions
7 . /etc/daemons.conf
9 NAME=x11vnc
10 DESC="VNC server"
11 DAEMON=/usr/bin/x11vnc
12 OPTIONS=$X11VNC_OPTIONS
14 case "$1" in
15 start)
16 if ps x | grep -v grep | grep -q $DAEMON; then
17 echo "$NAME already running."
18 exit 1
19 fi
20 echo -n "Starting $DESC: $NAME... "
21 $DAEMON $OPTIONS &
22 status
23 ;;
24 stop)
25 if ! ps x | grep -v grep | grep -q $DAEMON; then
26 echo "$NAME is not running."
27 exit 1
28 fi
29 echo -n "Stopping $DESC: $NAME... "
30 killall $(basename $DAEMON)
31 status
32 ;;
33 restart)
34 if ! ps x | grep -v grep | grep -q $DAEMON; then
35 echo "$NAME is not running."
36 exit 1
37 fi
38 echo -n "Restarting $DESC: $NAME... "
39 killall $(basename $DAEMON)
40 sleep 2
41 $DAEMON $OPTIONS &
42 status
43 ;;
44 *)
45 echo ""
46 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
47 echo ""
48 exit 1
49 ;;
50 esac
52 exit 0