nut/nut.system-sleep
Stanislav Brabec 8bc42be341 Accepting request 228899 from home:sbrabec:branches:hardware
- Replace powersave support by systemd (bnc#871406).

- explicitly require udev to fix buildenvironment issues 

- Replace pm-utils support by systemd (FATE#316824).

OBS-URL: https://build.opensuse.org/request/show/228899
OBS-URL: https://build.opensuse.org/package/show/hardware/nut?expand=0&rev=45
2014-04-03 14:56:12 +00:00

18 lines
662 B
Bash

#!/bin/bash
# Always stop nut before sleep, but do not initiate powerdown for hybrid-sleep.
if [ "$1" = pre ] && ( [ "$2" = hibernate ] || [ "$2" = hybrid-sleep ] ) ; then
/sbin/service upsd.service stop
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
if test -n "$POWERDOWNFLAG" -a -f "$POWERDOWNFLAG" ; then
export UPSD_POWERDOWN_CONDITION=1
/etc/init.d/upsd try-powerdown
fi
fi
if [ "$1" = post ] && ( [ "$2" = hibernate ] || [ "$2" = hybrid-sleep ] ) ; then
/sbin/service upsd.service start
fi