blob: e6582c69d0f45c99325b22c92d72dcb4a6a840c0 [file] [log] [blame]
#!/bin/sh
#
# Run the daemon
#
DAEMON="udhcpc"
PIDFILE="/var/run/$DAEMON.pid"
EXEC="/sbin/udhcpc"
EXEC_ARGS=""
start() {
echo -n "Starting $DAEMON... "
source /etc_rw/default/$DAEMON
start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $OPTIONS
[ $? -eq 0 ] && echo "OK" || echo "ERROR"
}
stop() {
echo -n "Stopping $DAEMON... "
start-stop-daemon -K -p $PIDFILE
[ $? -eq 0 ] && echo "OK" || echo "ERROR"
}
restart() {
stop
start
}
case "$1" in
start|stop|restart)
"$1"
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?