Update of /cvsroot/devil-linux/build/scripts/scripts
In directory sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv2854/scripts
Added Files:
nut nut.config
Log Message:
more fixes
--- NEW FILE: nut ---
#!/bin/bash
# NUT init.d script added by Alberto Benati <be...@ec...>
### BEGIN INIT INFO
# Provides: nut
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 1 6
# Description: starts nut
### END INIT INFO
# settings
source /etc/sysconfig/config
# parameters
NAME="nut service"
CONFIGNAME=NUT
DAEMON=/usr/bin/upsdrvctl
PARAMETER=
# source function library
source /etc/init.d/functions
eval START=\$START_$CONFIGNAME
# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}
# Force execution if not called by a runlevel directory.
test $link = $base && START=yes
test "$START" = "yes" || exit 0
if [ ! -e $DAEMON ]; then
echo
echo "$DAEMON not found. Did you install the package?"
exit 1
fi
CONFIG=/etc/sysconfig/nut
if [ ! -e $CONFIG ]; then
echo "Configuration file $CONFIG not found!"
exit 1
fi
source $CONFIG
case "$1" in
start)
echo -n "Starting $NAME: "
${DAEMON}
evaluate_retval
;;
stop)
echo -n "Shutting down $NAME "
killproc ${DAEMON}
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
--- NEW FILE: nut.config ---
UPS_PORT="/dev/ttyS0"
USER="nut"
GROUP="nut"
if [ -n "$UPS_PORT" ]; then
chmod 0600 $UPS_PORT
chown $USER:$GROUP $UPS_PORT
fi
|