mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
060221841f
Thanks to Fabio Bas for the bug report and solution. Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
35 lines
1,019 B
Diff
35 lines
1,019 B
Diff
diff -Nur apcupsd-3.14.14.orig/platforms/slackware/apcupsd.in apcupsd-3.14.14/platforms/slackware/apcupsd.in
|
|
--- apcupsd-3.14.14.orig/platforms/slackware/apcupsd.in 2015-01-29 08:13:25.000000000 -0600
|
|
+++ apcupsd-3.14.14/platforms/slackware/apcupsd.in 2017-05-29 21:34:28.782782149 -0500
|
|
@@ -9,17 +9,18 @@
|
|
APCPID=@PIDDIR@/apcupsd.pid
|
|
DISTVER="@DISTVER@"
|
|
|
|
-return=" Done."
|
|
+return=""
|
|
|
|
|
|
case "$1" in
|
|
start)
|
|
rm -f @PWRFAILDIR@/powerfail
|
|
rm -f @nologdir@/nologin
|
|
- echo -n "Starting apcupsd power management.."
|
|
+ echo -n "Starting apcupsd power management: /sbin/apcupsd"
|
|
if [ -f ${APCPID} ]; then
|
|
return=" Already running."
|
|
else
|
|
+ mkdir -p @LOCKDIR@
|
|
@sbindir@/apcupsd && touch @LOCKDIR@/apcupsd \
|
|
|| return=" Failed."
|
|
fi
|
|
@@ -29,8 +30,9 @@
|
|
stop)
|
|
echo -n "Stopping apcupsd power management.."
|
|
if [ -f ${APCPID} ]; then
|
|
- THEPID=`cat ${APCPID}`
|
|
+ THEPID=$(cat ${APCPID})
|
|
kill ${THEPID} || return=" Failed."
|
|
+ sleep 2
|
|
rm -f ${APCPID}
|
|
else
|
|
return=" Nothing to stop."
|