From f1fe938e761f2b6a58c922ef74f0b1a26a1acda8 Mon Sep 17 00:00:00 2001 From: James Rayner Date: Sun, 21 Nov 2010 14:26:40 +1100 Subject: Update pm-utils handler --- contrib/pm-utils.handler | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'contrib/pm-utils.handler') 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 -- cgit v1.2.3-24-g4f1b