diff options
Diffstat (limited to 'community/inputattach/inputattach.rc.d')
-rw-r--r-- | community/inputattach/inputattach.rc.d | 49 |
1 files changed, 13 insertions, 36 deletions
diff --git a/community/inputattach/inputattach.rc.d b/community/inputattach/inputattach.rc.d index 7f260f9f8..6b92827be 100644 --- a/community/inputattach/inputattach.rc.d +++ b/community/inputattach/inputattach.rc.d @@ -1,60 +1,37 @@ #!/bin/bash -daemon_name=inputattach - . /etc/rc.conf - -. /etc/conf.d/$daemon_name.conf - . /etc/rc.d/functions - -get_pid() { - pidof $daemon_name -} +. /etc/conf.d/inputattach case "$1" in start) - stat_busy "Starting $daemon_name daemon" - - PID=`get_pid` - if [ -z "$PID" ]; then - [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid - # RUN - $daemon_name --daemon $IAMODE $IADEV - # - if [ $? -gt 0 ]; then + stat_busy "Starting inputattach" + for param in ${IAPARAMS[@]}; do + if ! /usr/sbin/inputattach --daemon $param; then stat_fail exit 1 - else - echo `get_pid` > /var/run/$daemon_name.pid - add_daemon $daemon_name - stat_done fi - else - stat_fail - exit 1 - fi - ;; + done + add_daemon inputattach + stat_done + ;; stop) - stat_busy "Stopping $daemon_name daemon" - PID=`get_pid` - # KILL - [ ! -z "$PID" ] && kill $PID &> /dev/null - # + stat_busy "Stopping inputattach" + PID=`pidof -o %PPID /usr/sbin/inputattach` + [ ! -z "$PID" ] && kill $PID &>/dev/null if [ $? -gt 0 ]; then stat_fail exit 1 else - rm -f /var/run/$daemon_name.pid &> /dev/null - rm_daemon $daemon_name + rm_daemon inputattach stat_done fi ;; - restart) $0 stop - sleep 3 + sleep 1 $0 start ;; *) |