2017-10-31 23:36:58 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Start/stop dhcpcd
|
|
|
|
#
|
|
|
|
|
|
|
|
DAEMON=/sbin/dhcpcd
|
|
|
|
CONFIG=/etc/dhcpcd.conf
|
2022-09-05 03:09:13 +02:00
|
|
|
PIDFILE=/var/run/dhcpcd/pid
|
2017-10-31 23:36:58 +01:00
|
|
|
|
|
|
|
[ -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
|