[Pkg-utopia-maintainers] Bug#416368: hibernate scriptlet for
networkmanager
Markus Becker
mab at comnets.uni-bremen.de
Thu Apr 12 07:57:07 UTC 2007
Attached is a scriptlet that sends networkmanager to sleep when
suspending and wakes networkmanager up on resume. It has hardcoded
/usr/bin/dbus-send and some vechos in there, but works for me(TM).
Add to /etc/hibernate/common.conf to enable the scriptlet:
### network manager
EnableNMReconnect yes
I'm a cc'ing a related networkmanager bug.
Best regards,
Markus Becker
------------------------------------------------
| Dipl.-Ing. Markus Becker
| Communication Networks
| Mobile Research Center
| TZI - Center for Computing Technologies
| University Bremen
| Germany
------------------------------------------------
| web: http://www.comnets.uni-bremen.de/~mab/
| mailto: mab at comnets.uni-bremen.de
| telephone: +49 421 218 2287
| building: NW1 room: N2260
------------------------------------------------
-------------- next part --------------
# -*- sh -*-
# vim:ft=sh:ts=8:sw=4:noet
###
## Disconnects NetworkManager on suspend and connects on resume. This is the equivalent of
## clicking the "Switch to Offline" button before suspending, and clicking the
## "Switch to Online" button after resuming.
##
## Author: Markus Becker
## Credits:
## Based on kopete scriplet from Pat Double <pat at patdouble.com>
##
###
AddConfigHandler NMOptions
AddConfigHelp "EnableNMReconnect <boolean>" "Disconnect and reconnect NM before and after suspending."
NMSuspend() {
vecho 3 "nm: sleep"
/usr/bin/dbus-send --system \
--dest=org.freedesktop.NetworkManager \
--type=method_call /org/freedesktop/NetworkManager \
org.freedesktop.NetworkManager.sleep
vecho 3 "nm: sleep 2"
return 0
}
NMResume() {
vecho 3 "nm: wake"
/usr/bin/dbus-send --system \
--dest=org.freedesktop.NetworkManager \
--type=method_call /org/freedesktop/NetworkManager \
org.freedesktop.NetworkManager.wake
vecho 3 "nm: wake2"
return 0
}
NMOptions() {
case $1 in
enablenmreconnect)
BoolIsOn "$1" "$2" && NM_ENABLED=1 || return 0
;;
*)
return 1
esac
if [ -z "$NM_HOOKED" ] ; then
vecho 0 "nm: hook"
AddSuspendHook 61 NMSuspend
AddResumeHook 61 NMResume
NM_HOOKED=1
fi
return 0
}
More information about the Pkg-utopia-maintainers
mailing list