#!/usr/bin/python | |
import dbus, flimflam, sys | |
if (len(sys.argv) < 2): | |
print "Usage: %s <service> <carrier>" % (sys.argv[0]) | |
sys.exit(1) | |
(_, service_name, carrier) = sys.argv | |
flim = flimflam.FlimFlam(dbus.SystemBus()) | |
service = flim.FindElementByNameSubstring('Service', | |
service_name) | |
if not service: | |
print "Could not find service: %s" % (service_name) | |
sys.exit(1) | |
print "Activating service %s" % (service.object_path) | |
service.ActivateCellularModem(carrier) |