Yves Guérin wrote:
Hello,

I redo the rc.d script

#!/bin/sh


# PatrioteBSD - Yves Guerin - [EMAIL PROTECTED] - 2008-07-10
#########################################
# JAMAIS TESTE AVEC upsd_enable="yes"
# NEVER TESTED WITH upsd_enable="YES"
#########################################

# mettre dans /etc/rc.conf: upsd_enable="YES"

I don't think it's a good idea to have comments not in English.

# PROVIDE: upsd
# REQUIRE: DAEMON
# BEFORE: shutdown

. /etc/rc.subr

name="upsd"
upsd_enable=${upsd_enable:-"NO"}
rcvar=`set_rcvar`

start_cmd="upsd_start"
stop_cmd="upsd_stop"

upsd_start()
{
        [ -x /usr/local/sbin/upsd ] && /usr/local/sbin/upsd && echo -n ' upsd'
}

upsd_stop()
{
         [ -f /var/run/upsd.pid ] && kill -QUIT `cat /var/run/upsd.pid` && echo 
-n ' upsd'
}

Really start/stop could be (and should be) done with rc.subr subroutines.


load_rc_config $name
run_rc_command "$1"


--
Dixi.
Sem.
_______________________________________________
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to