Imported Upstream version 2.7.1
This commit is contained in:
parent
a1fa151fc7
commit
0121794af9
451 changed files with 41339 additions and 10887 deletions
63
scripts/Solaris/nut.in
Normal file
63
scripts/Solaris/nut.in
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
#!/sbin/sh
|
||||
|
||||
#init.d script to start nut services
|
||||
|
||||
NUT_DIR="@prefix@"
|
||||
CONFIG=$NUT_DIR/etc/nut.conf
|
||||
|
||||
if [ -f $CONFIG ] ; then
|
||||
. $CONFIG
|
||||
fi
|
||||
|
||||
ups_stop () {
|
||||
pkill -n upsmon
|
||||
pkill -n upsd
|
||||
${NUT_DIR}/bin/upsdrvctl stop > /dev/null 2>&1
|
||||
}
|
||||
|
||||
ups_start () {
|
||||
if [ "$MODE" = "none" ];then
|
||||
echo No mode set
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! "$MODE" = "netclient" ];then
|
||||
$NUT_DIR/bin/upsdrvctl start #> /dev/null 2>&1
|
||||
$NUT_DIR/sbin/upsd #> /dev/null 2>&1
|
||||
fi
|
||||
$NUT_DIR/sbin/upsmon #> /dev/null 2>&1
|
||||
}
|
||||
|
||||
case $1 in
|
||||
'start')
|
||||
ups_start
|
||||
;;
|
||||
|
||||
'stop')
|
||||
ups_stop
|
||||
;;
|
||||
|
||||
'restart')
|
||||
ups_stop
|
||||
while pgrep upsd > /dev/null
|
||||
do
|
||||
sleep 1
|
||||
done
|
||||
ups_start
|
||||
;;
|
||||
'poweroff')
|
||||
$NUT_DIR/sbin/upsmon -K >/dev/null 2>&1
|
||||
if [ $? = 0 ]; then
|
||||
echo "Shutting down the UPS ..."
|
||||
#$NUT_DIR/bin/upsdrvctl shutdown
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
echo "Usage: '$0' {start | stop | restart }"
|
||||
echo ""
|
||||
exit 64
|
||||
;;
|
||||
|
||||
esac
|
||||
exit $?
|
||||
Loading…
Add table
Add a link
Reference in a new issue