answered
2014-09-19 17:47:09 +0200
For wifi:
Turn off:
/bin/dbus-send --print-reply --type=method_call --system --dest=net.connman /net/connman/technology/wifi net.connman.Technology.SetProperty string:Powered variant:boolean:false
Turn on:
/bin/dbus-send --print-reply --type=method_call --system --dest=net.connman /net/connman/technology/wifi net.connman.Technology.SetProperty string:Powered variant:boolean:true
For cellular:
(complex method but not sure what happens if you disable the technology.)
First you need to find the service:
/bin/dbus-send --system --type=method_call --print-reply --dest=net.connman / net.connman.Manager.GetServices
Its service path will be something with cellular_<lots_of_numbers>_context1</lots_of_numbers>
/bin/dbus-send --system --type=method_call --print-reply --dest=net.connman /net/connman/service/cellular_<blah>_<blah> net.connman.Service.Disconnect
And same with Connect if you want it to reconnect
Otherwise:
off:
/bin/dbus-send --print-reply --type=method_call --system --dest=net.connman /net/connman/technology/cellular net.connman.Technology.SetProperty string:Powered variant:boolean:false
on:
/bin/dbus-send --print-reply --type=method_call --system --dest=net.connman /net/connman/technology/cellular net.connman.Technology.SetProperty string:Powered variant:boolean:false
There should also be a connman tool to make things easier.