wok-6.x view x11vnc/stuff/x11vnc @ rev 21763

busybox: enable CONFIG_FDISK_SUPPORT_LARGE_DISKS
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jun 27 14:19:03 2019 +0200 (2019-06-27)
parents 4f1b00a89af1
children
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="$(_ '%s server' VNC)"
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 _ '%s is already running.' $NAME
18 exit 1
19 fi
20 action 'Starting %s: %s...' "$DESC" $NAME
21 $DAEMON $OPTIONS &
22 status
23 ;;
24 stop)
25 if ! ps x | grep -v grep | grep -q $DAEMON; then
26 _ '%s is not running.' $NAME
27 exit 1
28 fi
29 action 'Stopping %s: %s...' "$DESC" $NAME
30 killall $(basename $DAEMON)
31 status
32 ;;
33 restart)
34 if ! ps x | grep -v grep | grep -q $DAEMON; then
35 _ '%s is not running.' $NAME
36 exit 1
37 fi
38 action 'Restarting %s: %s...' "$DESC" $NAME
39 killall $(basename $DAEMON)
40 sleep 2
41 $DAEMON $OPTIONS &
42 status
43 ;;
44 *)
45 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
46 newline
47 exit 1
48 ;;
49 esac
51 exit 0