hope this works
This commit is contained in:
parent
bdb0d045b8
commit
3cf8945a5d
@ -58,10 +58,15 @@ class Config:
|
||||
return val
|
||||
|
||||
def __init__(self):
|
||||
print(os.environ, file=sys.stderr)
|
||||
self.reason = Reason(os.environ["reason"])
|
||||
self.vpn_gateway = ipaddress.ip_address(os.environ["VPNGATEWAY"])
|
||||
self.vpn_pid = int(os.environ["VPNPID"]) if "VPNPID" in os.environ else None
|
||||
if self.reason not in {
|
||||
Reason.CONNECT,
|
||||
Reason.ATTEMPT_RECONNECT,
|
||||
Reason.RECONNECT,
|
||||
}:
|
||||
return
|
||||
self.tun_device = os.environ["TUNDEV"]
|
||||
ip4_addr = os.environ["INTERNAL_IP4_ADDRESS"]
|
||||
if "INTERNAL_IP4_NETMASKLEN" in os.environ:
|
||||
@ -73,10 +78,12 @@ class Config:
|
||||
self.internal_ipv4_dns = [
|
||||
ipaddress.IPv4Address(str_addr)
|
||||
for str_addr in os.environ.get("INTERNAL_IP4_DNS", "").split(" ")
|
||||
if str_addr != ""
|
||||
]
|
||||
self.internal_ipv4_wins = [
|
||||
ipaddress.IPv4Address(str_addr)
|
||||
for str_addr in os.environ.get("INTERNAL_IP4_NBNS", "").split(" ")
|
||||
if str_addr != ""
|
||||
]
|
||||
# TODO: ipv6 support
|
||||
self.default_domain = os.environ.get("CISCO_DEF_DOMAIN", "")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user