sane-vpn: fix so that sane-vpn do
works even without hickory-dns installed
This commit is contained in:
@@ -294,6 +294,11 @@ stores = {{ type = "forward", name_servers = [
|
|||||||
'''
|
'''
|
||||||
elif dir_ == ToggleDir.Down:
|
elif dir_ == ToggleDir.Down:
|
||||||
text = ""
|
text = ""
|
||||||
|
|
||||||
|
if not os.path.isdir("/var/lib/hickory-dns"):
|
||||||
|
logger.info("not restarting hickory-dns because it appears to not be in use")
|
||||||
|
return
|
||||||
|
|
||||||
with open("/var/lib/hickory-dns/dhcp-configs/sane-vpn.toml", "w") as f:
|
with open("/var/lib/hickory-dns/dhcp-configs/sane-vpn.toml", "w") as f:
|
||||||
f.write(text)
|
f.write(text)
|
||||||
subprocess.check_call([ "systemctl", "restart", "hickory-dns-localhost" ])
|
subprocess.check_call([ "systemctl", "restart", "hickory-dns-localhost" ])
|
||||||
|
Reference in New Issue
Block a user