]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/dhcpcd/S41dhcpcd
dhcpcd: don't test if the binary exists in the init script
[coffee/buildroot.git] / package / dhcpcd / S41dhcpcd
1 #!/bin/sh
2 #
3 # Start/stop dhcpcd
4 #
5
6 DAEMON=/sbin/dhcpcd
7 CONFIG=/etc/dhcpcd.conf
8 PIDFILE=/var/run/dhcpcd.pid
9
10 [ -f $CONFIG ] || exit 0
11
12 case "$1" in
13   start)
14         echo "Starting dhcpcd..."
15         start-stop-daemon -S -x "$DAEMON" -p "$PIDFILE" -- -f "$CONFIG"
16         ;;
17   stop)
18         echo "Stopping dhcpcd..."
19         start-stop-daemon -K -x "$DAEMON" -p "$PIDFILE" -o
20         ;;
21   reload|force-reload)
22         echo "Reloading dhcpcd configuration..."
23         "$DAEMON" -s reload
24         ;;
25   restart)
26         "$0" stop
27         sleep 1 # Prevent race condition: ensure dhcpcd stops before start.
28         "$0" start
29         ;;
30   *)
31         echo "Usage: $0 {start|stop|restart|reload|force-reload}"
32         exit 1
33 esac