Build fix for Leap 15.6: - remove obsolete text concerning apcupsd-early-powerdown in README.SUSE - do not use /sbin/service, call systemctl directly - Leap 15.6 also needs util-linux-tty-tools - Patch configure to show correct GCC version (not configure.in, autoreconf fails) - Use %make_build in spec file OBS-URL: https://build.opensuse.org/request/show/1186572 OBS-URL: https://build.opensuse.org/package/show/hardware/apcupsd?expand=0&rev=104
16 lines
586 B
Bash
16 lines
586 B
Bash
#!/bin/bash
|
|
|
|
|
|
# Always stop apcupsd before sleep, but do not initiate powerdown for hybrid-sleep.
|
|
if [ "$1" = pre ] && ( [ "$2" = hibernate ] || [ "$2" = hybrid-sleep ] ) ; then
|
|
/usr/bin/systemctl stop apcupsd.service
|
|
fi
|
|
if [ "$1" = pre ] && [ "$2" = hibernate ] ; then
|
|
# FIXME: All hibernate quirks are called in parallel. To be on a safest side, we should initiate powerdown grace period when they terminate.
|
|
sleep 5
|
|
/etc/apcupsd/apccontrol killpower
|
|
fi
|
|
if [ "$1" = post ] && ( [ "$2" = hibernate ] || [ "$2" = hybrid-sleep ] ) ; then
|
|
/usr/bin/systemctl start apcupsd.service
|
|
fi
|