mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 12:58:07 +01:00
Refactored networking.py to not have to create a new wnettools interface every time a method gets called. Now it reuses the same one and makes changes to the iface name/driver as needed. Refactored a few methods in wnettools.py to be organized more logically and reduce external program calls. In experimental branch, added a few methods to networking/wnettools that can be used for enabling/disabling interfaces, as well as unloading/loading the driver associated with an interface. Added a check for mii-tool/ethtool that gets run when wicd starts, so it can decide which to use to check for a wired connection. Added a check for ip, to decide how to flush the routing tables. Rewrote some of the DHCP client checking code. Added a method (that's currently unused) to release a dhcp lease for each of the supported clients.
39 lines
1.1 KiB
Python
Executable File
39 lines
1.1 KiB
Python
Executable File
#!/usr/bin/python
|
|
|
|
""" Suspends the wicd daemon.
|
|
|
|
Sets a flag in the daemon that will stop it from monitoring networkg status.
|
|
Used for when a laptop enters hibernation/suspension.
|
|
|
|
"""
|
|
|
|
#
|
|
# Copyright (C) 2007 Adam Blackburn
|
|
# Copyright (C) 2007 Dan O'Reilly
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License Version 2 as
|
|
# published by the Free Software Foundation.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
|
|
import dbus
|
|
import dbus.service
|
|
|
|
bus = dbus.SystemBus()
|
|
proxy_obj = bus.get_object('org.wicd.daemon', '/org/wicd/daemon')
|
|
daemon = dbus.Interface(proxy_obj, 'org.wicd.daemon')
|
|
|
|
if __name__ == '__main__':
|
|
daemon.Disconnect()
|
|
daemon.SetForcedDisconnect(False)
|
|
daemon.SetSuspend(True)
|
|
|