summaryrefslogtreecommitdiff
path: root/dhcp/dhclient
blob: 9163753baf91030186e65d89cb0fa91bb76204f4 (plain)
    1 #!/bin/sh
    2 #
    3 # /etc/rc.d/dhcpcd: start/stop dhcp client
    4 #
    5 
    6 SSD=/sbin/start-stop-daemon
    7 PROG=/usr/sbin/dhclient
    8 PID=/var/run/dhclient.pid
    9 OPTS="-q"
   10 
   11 case $1 in
   12 start)
   13         $SSD --start --pidfile $PID --exec $PROG -- $OPTS
   14         ;;
   15 stop)
   16         $SSD --stop --remove-pidfile --retry 10 --pidfile $PID
   17         ;;
   18 restart)
   19         $0 stop
   20         $0 start
   21         ;;
   22 reload)
   23         $SSD --stop --signal HUP --pidfile $PID
   24         ;;
   25 status)
   26         $SSD --status --pidfile $PID
   27         case $? in
   28         0) echo "$PROG is running" ;;
   29         1) echo "$PROG is not running but the pid file $PID exists" ;;
   30         3) echo "$PROG is not running" ;;
   31         4) echo "Unable to determine the program status" ;;
   32         esac
   33         ;;
   34 *)
   35         echo "usage: $0 [start|stop|restart|reload|status]"
   36         ;;
   37 esac
   38 
   39 # End of file

Generated by cgit