1#!/usr/bin/python
2
3import dbus, flimflam, sys
4
5if (len(sys.argv) < 2):
6    print "Usage: %s <mtu>" % (sys.argv[0])
7    sys.exit(1)
8
9(_, mtu) = sys.argv
10
11flim = flimflam.FlimFlam(dbus.SystemBus())
12
13for device in flim.GetObjectList("Device"):
14    device_properties = device.GetProperties(utf8_strings = True)
15
16    for path in device_properties["IPConfigs"]:
17        ipconfig = flim.GetObjectInterface("IPConfig", path)
18        ipconfig.SetProperty("Mtu", int(mtu))
19