wok-6.x annotate dhcp/stuff/dhcpd @ rev 19300
Add man-pages
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Jul 09 16:05:29 2016 +0300 (2016-07-09) |
parents | 7f188676b59c |
children | 13031b3df5bb |
rev | line source |
---|---|
pascal@5234 | 1 #!/bin/sh |
al@19161 | 2 # /etc/init.d/dhcpd: Start, stop and restart Dhcp daemon on SliTaz, at boot |
pascal@5234 | 3 # time or with the command line. |
pascal@5234 | 4 # |
pascal@5234 | 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS |
pascal@5234 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf. |
pascal@5234 | 7 # |
pascal@5234 | 8 . /etc/init.d/rc.functions |
pascal@5234 | 9 . /etc/daemons.conf |
pascal@5234 | 10 |
pascal@5234 | 11 NAME=Dhcpd |
al@19159 | 12 DESC="$(_ '%s daemon' DHCP)" |
pascal@5234 | 13 DAEMON=/usr/sbin/dhcpd |
pascal@5234 | 14 OPTIONS=$DHCPD_OPTIONS |
pascal@5234 | 15 PIDFILE=/var/run/dhcpd.pid |
pascal@5234 | 16 |
pascal@5234 | 17 case "$1" in |
pascal@5234 | 18 start) |
pascal@5234 | 19 if active_pidfile $PIDFILE dhcpd ; then |
al@19159 | 20 _ '%s is already running.' $NAME |
pascal@5234 | 21 exit 1 |
pascal@5234 | 22 fi |
al@19159 | 23 action 'Starting %s: %s...' "$DESC" $NAME |
al@19159 | 24 $DAEMON $OPTIONS |
pascal@5234 | 25 status |
pascal@5234 | 26 ;; |
pascal@5234 | 27 stop) |
pascal@5234 | 28 if ! active_pidfile $PIDFILE dhcpd ; then |
al@19159 | 29 _ '%s is not running.' $NAME |
pascal@5234 | 30 exit 1 |
pascal@5234 | 31 fi |
al@19159 | 32 action 'Stopping %s: %s...' "$DESC" $NAME |
al@19159 | 33 kill $(cat $PIDFILE) |
pascal@5234 | 34 status |
pascal@5234 | 35 ;; |
pascal@5234 | 36 restart) |
pascal@5234 | 37 if ! active_pidfile $PIDFILE dhcpd ; then |
al@19159 | 38 _ '%s is not running.' $NAME |
pascal@5234 | 39 exit 1 |
pascal@5234 | 40 fi |
al@19159 | 41 action 'Restarting %s: %s...' "$DESC" $NAME |
al@19159 | 42 kill $(cat $PIDFILE) |
pascal@5234 | 43 sleep 2 |
pascal@5234 | 44 $DAEMON $OPTIONS |
pascal@5234 | 45 status |
pascal@5234 | 46 ;; |
pascal@5234 | 47 *) |
al@19159 | 48 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" |
al@19159 | 49 newline |
pascal@5234 | 50 exit 1 |
pascal@5234 | 51 ;; |
pascal@5234 | 52 esac |
pascal@5234 | 53 |
pascal@5234 | 54 exit 0 |