From 0fb54f161f5344f5a7e764801e202337b6d0e451 Mon Sep 17 00:00:00 2001 From: Arturo FilastoĢ€ Date: Fri, 19 Aug 2011 17:27:01 +0200 Subject: Allow writing to network/interfaces file for wireless network settings --- packages/torouter-web/src/tui/controllers/network.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'packages/torouter-web/src/tui/controllers') diff --git a/packages/torouter-web/src/tui/controllers/network.py b/packages/torouter-web/src/tui/controllers/network.py index bf48f54..690dc3f 100644 --- a/packages/torouter-web/src/tui/controllers/network.py +++ b/packages/torouter-web/src/tui/controllers/network.py @@ -2,7 +2,7 @@ import web from tui import config from tui import view from tui.view import render -from tui.utils import session,configuration,parsing +from tui.utils import session, configuration, parsing, fileio """ This function is used to generate the network @@ -75,6 +75,16 @@ Wireless network configuration page class wireless: # XXX do all the backend stuff def update_config(self, data): + itfc = parsing.interfaces(config.interfaces_file) + itfc.parse() + itfc.set_ssid(data.essid) + itfc.set_mac(data.mac) + itfc.wifi['netmask'] = data.netmask + itfc.wifi['address'] = data.address + filecontent = itfc.exclude_output("uap0") + itfc.output(itfc.wifi) + files = [('/etc/network/interfaces', filecontent)] + fileio.write(files) + #print itfc.output(itfc.wifi) return True def GET(self): -- cgit v1.2.3