#!/bin/bash DHCDBD_BIN=/sbin/dhcdbd # general config . /etc/rc.conf . /etc/rc.d/functions # Sanity checks. [ -x $DHCDBD_BIN ] || exit 0 # We need /usr/sbin/ip [ -x /usr/sbin/ip ] || exit 0 PID=`pidof -o %PPID $DHCDBD_BIN` case "$1" in start) ck_daemon dbus && /etc/rc.d/dbus start sleep 1 stat_busy "Starting the DBUS DHCP Client" if [ -z "$PID" ]; then $DHCDBD_BIN --system fi if [ ! -z "$PID" -o $? -gt 0 ]; then stat_fail else add_daemon dhcdbd stat_done fi ;; stop) stat_busy "Stopping DBUS DHCP Client" [ ! -z "$PID" ] && kill $PID &> /dev/null if [ $? -gt 0 ]; then stat_fail else rm_daemon dhcdbd stat_done fi ;; restart) $0 stop sleep 1 $0 start ;; *) echo "usage: $0 {start|stop|restart}" ;; esac exit 0