wok-current view x11vnc/stuff/x11vnc @ rev 4239
task: fix WGET (again)
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Thu Sep 24 17:50:39 2009 +0000 (2009-09-24) |
parents | 7fe44f4e2cda |
children | 4f1b00a89af1 |
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 | 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 | 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 | 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