xref: /OK3568_Linux_fs/buildroot/package/dhcpcd/S41dhcpcd (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2#
3# Start/stop dhcpcd
4#
5
6DAEMON=/sbin/dhcpcd
7CONFIG=/etc/dhcpcd.conf
8PIDFILE=/var/run/dhcpcd.pid
9
10[ -f $CONFIG ] || exit 0
11
12case "$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
33esac
34