mirror of
https://github.com/meshtastic/python.git
synced 2026-01-02 12:57:56 -05:00
Merge pull request #469 from marek22k/improve-argument-handling
Improve argument handling
This commit is contained in:
@@ -771,7 +771,10 @@ def onConnected(interface):
|
||||
if interface.noProto:
|
||||
logging.warning(f"Not starting Tunnel - disabled by noProto")
|
||||
else:
|
||||
tunnel.Tunnel(interface, subnet=args.tunnel_net)
|
||||
if args.tunnel_net:
|
||||
tunnel.Tunnel(interface, subnet=args.tunnel_net)
|
||||
else:
|
||||
tunnel.Tunnel(interface)
|
||||
|
||||
if args.ack or (args.dest != BROADCAST_ADDR and waitForAckNak):
|
||||
print(
|
||||
|
||||
@@ -49,6 +49,12 @@ class Tunnel:
|
||||
if not iface:
|
||||
raise Exception("Tunnel() must have a interface")
|
||||
|
||||
if not subnet:
|
||||
raise Exception("Tunnel() must have a subnet")
|
||||
|
||||
if not netmask:
|
||||
raise Exception("Tunnel() must have a netmask")
|
||||
|
||||
self.iface = iface
|
||||
self.subnetPrefix = subnet
|
||||
|
||||
|
||||
Reference in New Issue
Block a user