wok view dhcp/stuff/dhcpd @ rev 20414

Up lynis (2.6.6)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Aug 02 12:25:57 2018 +0200 (2018-08-02)
parents ff5fd8788cd9
children
line source
1 #!/bin/sh
2 # /etc/init.d/dhcpd: Start, stop and restart Dhcp daemon on SliTaz, at boot
3 # time or with the command line.
4 #
5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=Dhcpd
12 DESC="$(_ '%s daemon' DHCP)"
13 DAEMON=/usr/sbin/dhcpd
14 OPTIONS=$DHCPD_OPTIONS
15 PIDFILE=/var/run/dhcpd.pid
17 for i in $OPTIONS ; do
18 case "$i" in eth*.*) vconfig set_flag $i 1 1; esac
19 done
21 case "$1" in
22 start)
23 if active_pidfile $PIDFILE dhcpd ; then
24 _ '%s is already running.' $NAME
25 exit 1
26 fi
27 action 'Starting %s: %s...' "$DESC" $NAME
28 $DAEMON $OPTIONS
29 status
30 ;;
31 stop)
32 if ! active_pidfile $PIDFILE dhcpd ; then
33 _ '%s is not running.' $NAME
34 exit 1
35 fi
36 action 'Stopping %s: %s...' "$DESC" $NAME
37 kill $(cat $PIDFILE)
38 status
39 ;;
40 restart)
41 if ! active_pidfile $PIDFILE dhcpd ; then
42 _ '%s is not running.' $NAME
43 exit 1
44 fi
45 action 'Restarting %s: %s...' "$DESC" $NAME
46 kill $(cat $PIDFILE)
47 sleep 2
48 $DAEMON $OPTIONS
49 status
50 ;;
51 *)
52 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
53 newline
54 exit 1
55 ;;
56 esac
58 exit 0