S41dhcpcd 617 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. #
  3. # Start/stop dhcpcd
  4. #
  5. DAEMON=/sbin/dhcpcd
  6. CONFIG=/etc/dhcpcd.conf
  7. PIDFILE=/var/run/dhcpcd/pid
  8. [ -f $CONFIG ] || exit 0
  9. case "$1" in
  10. start)
  11. echo "Starting dhcpcd..."
  12. start-stop-daemon -S -x "$DAEMON" -p "$PIDFILE" -- -f "$CONFIG"
  13. ;;
  14. stop)
  15. echo "Stopping dhcpcd..."
  16. start-stop-daemon -K -x "$DAEMON" -p "$PIDFILE" -o
  17. ;;
  18. reload|force-reload)
  19. echo "Reloading dhcpcd configuration..."
  20. "$DAEMON" -s reload
  21. ;;
  22. restart)
  23. "$0" stop
  24. sleep 1 # Prevent race condition: ensure dhcpcd stops before start.
  25. "$0" start
  26. ;;
  27. *)
  28. echo "Usage: $0 {start|stop|restart|reload|force-reload}"
  29. exit 1
  30. esac