summaryrefslogtreecommitdiffstats
path: root/contrib/pm-utils.handler
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pm-utils.handler')
-rwxr-xr-xcontrib/pm-utils.handler24
1 files changed, 16 insertions, 8 deletions
diff --git a/contrib/pm-utils.handler b/contrib/pm-utils.handler
index f369a6b..80f2d4c 100755
--- a/contrib/pm-utils.handler
+++ b/contrib/pm-utils.handler
@@ -7,21 +7,29 @@
auto_resume()
{
- all_resume
- sleep 2
- # if didn't successfully resume wifi, and running net-auto daemon, then restart the daemon
- if [[ -f /var/run/daemons/net-auto && -x /usr/bin/netcfg-auto-wireless ]]; then
- if ! check_iface "$1" >/dev/null; then # ret=1 when iface down and available
- /usr/bin/netcfg-auto-wireless "$1"
- fi
+ if checkyesno ${RESTOREPROFILES:-no}; then
+ all_resume
+ sleep 2
fi
+ restartservice net-auto-wireless
+ restartservice net-auto-wired
+ restartservice net-profiles
}
+daemon_suspend_all()
+{
+ stopservice net-auto-wireless
+ stopservice net-auto-wired
+ stopservice net-profiles
+}
case "$1" in
hibernate|suspend_hybrid|suspend)
report_notify "suspending all interfaces..."
- interface_suspend all
+ daemon_suspend_all
+ if checkyesno "${RESTOREPROFILES:-no}"; then
+ interface_suspend all
+ fi
;;
thaw|resume)
if "$CONN_DIR/wireless" query wlan0 enabled; then