7 .
/etc
/conf.d
/$daemon_name
10 _pid
=$
(pidof
-o %PPID
$daemon_name)
11 if [[ -n $_pid ]]; then
21 if [[ -n $NOHOSTNAME ]]; then
22 [[ -n $HOSTNAME ]] && unset HOSTNAME
24 if [[ -n $HOSTNAME ]]; then
25 HOSTNAME
="-h ${HOSTNAME}"
27 HOSTNAME
="-h $(hostname)"
31 if [[ -n $INTERFACE ]]; then
32 INTERFACE
="-i ${INTERFACE}"
36 [[ -n $CONFIG ]] && CONFIG
="-c $CONFIG"
37 [[ -n $NODNS ]] && NODNS
="-d"
38 [[ -n $NOGW ]] && NOGW
="--no-gateway"
39 [[ -n $NOBOOTP ]] && NOBOOTP
="--no-bootp"
40 [[ -n $WINCI ]] && WINCI
="--win-client-ident"
42 if [[ -n $LEASEHOURS && -n $LEASESECS ]]; then
43 stat_append
"Error: LEASEHOURS and LEASESECS should not both be set in /etc/conf.d/$daemon_name.conf"
45 elif [[ -z $LEASEHOURS && -z $LEASESECS ]]; then
48 elif [[ -n $LEASEHOURS && -z $LEASESECS ]]; then
49 LEASESECS
="-L $((LEASEHOURS*3600))"
50 elif [[ -z $LEASEHOURS && -n $LEASESECS ]]; then
51 LEASESECS
="-L $LEASESECS"
58 stat_busy
"Starting $daemon_name daemon"
61 if [[ -z $PID ]]; then
62 [[ -f /var
/run
/$daemon_name.pid
]] &&
63 rm -f /var
/run
/$daemon_name.pid
65 $daemon_name ${CONFIG} ${HOSTNAME} ${INTERFACE} ${LEASESECS} ${NODNS} ${NOGW} ${NOBOOTP} ${WINCI}
67 if [[ $?
-gt 0 ]]; then
71 echo $PID > /var
/run
/$daemon_name.pid
72 add_daemon
$daemon_name
82 stat_busy
"Stopping $daemon_name daemon"
85 if [[ -n $PID ]]; then
86 $daemon_name ${INTERFACE} -k &>/dev
/null
87 if [[ $?
-gt 0 ]]; then
90 [[ -e /var
/run
/$daemon_name.pid
]] && rm -f /var
/run
/$daemon_name.pid
&> /dev
/null
91 rm_daemon
$daemon_name
106 if get_pid
&>/dev
/null
; then
107 stat_busy
"Reloading $daemon_name"
109 [[ $?
== 0 ]] && stat_done || stat_fail
111 echo "pump does not seem to be running." >&2
116 # ck_status $daemon_name
117 if get_pid
&>/dev
/null
; then
120 echo "pump does not seem to be running." >&2
127 echo "usage: $0 {start|stop|restart|renew|status}"
132 # vim:set ts=2 sw=2 et ft=sh: