diff options
author | James Rayner <james@rayner.id.au> | 2010-11-21 04:26:40 +0100 |
---|---|---|
committer | James Rayner <james@rayner.id.au> | 2010-11-21 04:26:40 +0100 |
commit | f1fe938e761f2b6a58c922ef74f0b1a26a1acda8 (patch) | |
tree | 2955978a8593806e422f1729f35452aa980f50d8 /contrib/pm-utils.handler | |
parent | 56faa91bae6523b587effeef964bc5e34927064e (diff) | |
download | netctl-f1fe938e761f2b6a58c922ef74f0b1a26a1acda8.tar.gz netctl-f1fe938e761f2b6a58c922ef74f0b1a26a1acda8.tar.xz |
Update pm-utils handler
Diffstat (limited to 'contrib/pm-utils.handler')
-rwxr-xr-x | contrib/pm-utils.handler | 24 |
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 |