summaryrefslogtreecommitdiffstats
path: root/system/nut/rc.ups
diff options
context:
space:
mode:
Diffstat (limited to 'system/nut/rc.ups')
-rw-r--r--system/nut/rc.ups76
1 files changed, 0 insertions, 76 deletions
diff --git a/system/nut/rc.ups b/system/nut/rc.ups
deleted file mode 100644
index 37916951bd..0000000000
--- a/system/nut/rc.ups
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/sh
-# Slackware startup script for Network UPS Tools
-# Copyright 2010 V'yacheslav Stetskevych
-
-# UPS drivers live here
-DRIVERPATH=/usr/libexec/nut
-export PATH=$DRIVERPATH:$PATH
-
-POWERDOWNFLAG=/etc/killpower
-NUTUSER=nut
-NUTGROUP=nut
-UPSDCONF=/etc/ups/upsd.conf
-UPSCONF=/etc/ups/ups.conf
-UPSMONCONF=/etc/ups/upsmon.conf
-
-# Check for existense of the nut user and group
-# For slackbuilds.org, assigned nut uid/gid are 218/218.
-# See http://slackbuilds.org/uid_gid.txt
-if ! grep -q ^$NUTGROUP: /etc/group; then
- echo " You must have a \"$NUTGROUP\" group to run this script."
- echo " # groupadd -g 218 $NUTGROUP"
- exit 1
-elif ! grep -q ^$NUTUSER: /etc/passwd; then
- echo " You must have a \"$NUTUSER\" user to run this script."
- echo " # useradd -u 218 -g $NUTGROUP -s /bin/false $NUTUSER"
- exit 1
-fi
-
-start_driver() {
- upsdrvctl -u $NUTUSER start || exit 1
-}
-
-start_upsd() {
- upsd -u $NUTUSER || exit 1
-}
-
-start_upsmon() {
- upsmon -u $NUTUSER || exit 1
-}
-
-stop() {
- echo "Stopping the UPS services... "
- if pgrep upsd 2>&1 >/dev/null; then
- upsd -c stop; fi
- if pgrep upsmon 2>&1 >/dev/null; then
- upsmon -c stop; fi
- upsdrvctl stop
-}
-
-case "$1" in
- start) # starts everything (for a ups server box)
- mkdir -p /var/run/nut
- chown $NUTUSER:$NUTGROUP /var/run/nut
- chmod 0770 /var/run/nut
- start_driver
- start_upsd
- start_upsmon
- ;;
- start_upsmon) # starts upsmon only (for a ups client box)
- start_upsmon
- ;;
- stop) # stops all UPS-related daemons
- stop
- ;;
- shutdown) # shuts down the UPS
- echo "Killing inverter..."
- upsdrvctl shutdown
- ;;
- reload)
- echo "Reloading config files..."
- upsd -c reload
- upsmon -c reload
- ;;
- *)
- echo "Usage: $0 {start|start_upsmon|stop|shutdown|reload}"
-esac