summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Rayner <james@rayner.id.au>2010-11-21 04:26:40 +0100
committerJames Rayner <james@rayner.id.au>2010-11-21 04:26:40 +0100
commitf1fe938e761f2b6a58c922ef74f0b1a26a1acda8 (patch)
tree2955978a8593806e422f1729f35452aa980f50d8
parent56faa91bae6523b587effeef964bc5e34927064e (diff)
downloadnetctl-f1fe938e761f2b6a58c922ef74f0b1a26a1acda8.tar.gz
netctl-f1fe938e761f2b6a58c922ef74f0b1a26a1acda8.tar.xz
Update 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