aboutsummaryrefslogtreecommitdiffstats
path: root/torouterui/server.py
diff options
context:
space:
mode:
authorficus <ficus@robocracy.org>2012-09-24 14:17:56 +0200
committerficus <ficus@robocracy.org>2012-09-24 14:17:56 +0200
commit862d0175747e46061f5ce59defe60ffb23fc3782 (patch)
tree8b9d43323a2805f9d87c58bb3388196308380634 /torouterui/server.py
parent52039642da2a578ce0e522353edc09f12cdd86f8 (diff)
downloadtui-862d0175747e46061f5ce59defe60ffb23fc3782.tar.gz
tui-862d0175747e46061f5ce59defe60ffb23fc3782.zip
pass through netif configuration
Diffstat (limited to 'torouterui/server.py')
-rw-r--r--torouterui/server.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/torouterui/server.py b/torouterui/server.py
index 17cd5ca..8ae4a3a 100644
--- a/torouterui/server.py
+++ b/torouterui/server.py
@@ -7,7 +7,27 @@ def main():
"""Primary entry-point for torouterui.
"""
parser = argparse.ArgumentParser()
- parser.add_argument('--debug', action='store_true',
+ parser.add_argument('--debug',
+ action='store_true',
help="enable debugging interface")
+ parser.add_argument('--host',
+ default="127.0.0.1",
+ help="listen on this host/IP")
+ parser.add_argument('--port',
+ type=int,
+ default=5050,
+ help="listen on this port")
+ parser.add_argument('--lanif',
+ default="eth1",
+ help="local ethernet interface (eth0 or eth1)")
+ parser.add_argument('--wanif',
+ default="eth0",
+ help="upstream ethernet interface (eth0 or eth1)")
+ parser.add_argument('--wifiif',
+ default="uap0",
+ help="wifi interface (uap0 or wlan0)")
args = parser.parse_args()
- app.run(debug=args.debug)
+ app.config['LAN_IF'] = args.lanif
+ app.config['WAN_IF'] = args.wanif
+ app.config['WIFI_IF'] = args.wifiif
+ app.run(debug=args.debug, host=args.host, port=args.port)