aboutsummaryrefslogtreecommitdiffstats
path: root/torouterui/server.py
blob: 8ae4a3a1728d7e0d03700411cdf61f9784343cba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

from torouterui import app
import argparse


def main():
    """Primary entry-point for torouterui.
    """
    parser = argparse.ArgumentParser()
    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.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)