blob: 08c85d0091da5af4e41a26230c125d1047517e80 [file] [log] [blame]
xf.li86118912025-03-19 20:07:27 -07001#!/bin/sh
2#
3# Run the daemon
4#
5
6DAEMON="udhcpd"
7PIDFILE="/var/run/$DAEMON.pid"
8EXEC="/usr/sbin/udhcpd"
9EXEC_ARGS=""
10
11
12start() {
13 echo -n "Starting $DAEMON... "
14 source /etc_rw/default/$DAEMON
15 start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $OPTIONS
16 [ $? -eq 0 ] && echo "OK" || echo "ERROR"
17}
18
19stop() {
20 echo -n "Stopping $DAEMON... "
21 start-stop-daemon -K -p $PIDFILE
22 [ $? -eq 0 ] && echo "OK" || echo "ERROR"
23}
24
25restart() {
26 stop
27 start
28}
29
30case "$1" in
31 start|stop|restart)
32 "$1"
33 ;;
34 *)
35 echo "Usage: $0 {start|stop|restart}"
36 exit 1
37esac
38
39exit $?