summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkloczek2001-04-24 04:31:17 (GMT)
committercvs2git2012-06-24 12:13:13 (GMT)
commite1804ffc3ae83ac0b98c280d13d194cdca40ba5b (patch)
tree1d0e3c7cef43ea7964e2841d51e21163b9ca146c
parent953cfbf111e2039cab8911cacc503b2f086d4b89 (diff)
downloadpowerd-e1804ffc3ae83ac0b98c280d13d194cdca40ba5b.zip
powerd-e1804ffc3ae83ac0b98c280d13d194cdca40ba5b.tar.gz
- raw version from tar ball (must be rewrited).
Changed files: powerd.init -> 1.1
-rw-r--r--powerd.init74
1 files changed, 74 insertions, 0 deletions
diff --git a/powerd.init b/powerd.init
new file mode 100644
index 0000000..1397827
--- /dev/null
+++ b/powerd.init
@@ -0,0 +1,74 @@
+#! /bin/sh
+#
+# pwerdd Start/Stop James Brents power daemon.
+#
+# chkconfig: 345 75 65
+# description: The power daemon provides a means of determining when the
+# power is off, wether through a serial port connected on
+# this machine, or a remote server, and allows the safe
+# shutdown of the machine.
+# processname: powerd
+# pidfile: /var/run/powerd.pid
+# config: /etc/powerd.conf
+
+# Source function library.
+. /etc/init.d/functions
+
+# Get config.
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if [ ${NETWORKING} = "no" ]
+then
+ exit 0
+fi
+
+[ -x /usr/sbin/powerd ] || exit 0
+
+RETVAL=0
+
+start() {
+ echo -n "Starting powerd: "
+ daemon powerd
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/powerd
+ return $RETVAL
+}
+
+stop() {
+ echo -n "Stopping powerd services: "
+ killproc powerd
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/powerd
+ return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status powerd
+ ;;
+ restart|reload)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/powerd ]; then
+ stop
+ start
+ fi
+ ;;
+ *)
+ echo "Usage: powerd {start|stop|status|restart|reload|condrestart}"
+ exit 1
+esac
+
+exit $RETVAL