diff --git a/pkgs/by-name/sane-scripts/src/sane-vpn b/pkgs/by-name/sane-scripts/src/sane-vpn index 47200ff94..9de44ba9e 100755 --- a/pkgs/by-name/sane-scripts/src/sane-vpn +++ b/pkgs/by-name/sane-scripts/src/sane-vpn @@ -294,6 +294,11 @@ stores = {{ type = "forward", name_servers = [ ''' elif dir_ == ToggleDir.Down: 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: f.write(text) subprocess.check_call([ "systemctl", "restart", "hickory-dns-localhost" ])