summaryrefslogtreecommitdiffstats
path: root/package/dhcpcd/S41dhcpcd
blob: 3e5c22f715b17a450f31d7869d296c9f63ea9c1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
#
# Start/stop dhcpcd
#

DAEMON=/sbin/dhcpcd
CONFIG=/etc/dhcpcd.conf
PIDFILE=/var/run/dhcpcd.pid

[ -f $CONFIG ] || exit 0

case "$1" in
  start)
	echo "Starting dhcpcd..."
	start-stop-daemon -S -x "$DAEMON" -p "$PIDFILE" -- -f "$CONFIG"
	;;
  stop)
	echo "Stopping dhcpcd..."
	start-stop-daemon -K -x "$DAEMON" -p "$PIDFILE" -o
	;;
  reload|force-reload)
	echo "Reloading dhcpcd configuration..."
	"$DAEMON" -s reload
	;;
  restart)
	"$0" stop
	sleep 1 # Prevent race condition: ensure dhcpcd stops before start.
	"$0" start
	;;
  *)
	echo "Usage: $0 {start|stop|restart|reload|force-reload}"
	exit 1
esac
OpenPOWER on IntegriCloud