wok-current view x11vnc/stuff/x11vnc @ rev 18522
xchm: typo
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon Oct 26 11:47:37 2015 +0200 (2015-10-26) |
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