Changeset View
Changeset View
Standalone View
Standalone View
pdns_recursor.in
- This file was copied to avahi-daemon.in, mdnsd.in.
| #!/bin/sh | #!/bin/sh | ||||
| # Copyright (c) 2009-2019 Roy Marples | # Copyright (c) 2009-2023 Roy Marples | ||||
| # All rights reserved | # All rights reserved | ||||
| # PowerDNS Recursor subscriber for resolvconf | # PowerDNS Recursor subscriber for resolvconf | ||||
| # Redistribution and use in source and binary forms, with or without | # Redistribution and use in source and binary forms, with or without | ||||
| # modification, are permitted provided that the following conditions | # modification, are permitted provided that the following conditions | ||||
| # are met: | # are met: | ||||
| # * Redistributions of source code must retain the above copyright | # * Redistributions of source code must retain the above copyright | ||||
| Show All 38 Lines | while [ -n "$ns" ]; do | ||||
| newns="$newns${newns:+,}${ns%%,*}" | newns="$newns${newns:+,}${ns%%,*}" | ||||
| [ "$ns" = "${ns#*,}" ] && break | [ "$ns" = "${ns#*,}" ] && break | ||||
| ns="${ns#*,}" | ns="${ns#*,}" | ||||
| done | done | ||||
| [ -n "$newns" ] && newzones="$newzones${d%%:*}=$newns$NL" | [ -n "$newns" ] && newzones="$newzones${d%%:*}=$newns$NL" | ||||
| done | done | ||||
| # Try to ensure that config dirs exist | # Try to ensure that config dirs exist | ||||
| if type config_mkdirs >/dev/null 2>&1; then | if command -v config_mkdirs >/dev/null 2>&1; then | ||||
| config_mkdirs "$pdnsd_zones" | config_mkdirs "$pdnsd_zones" | ||||
| else | else | ||||
| @SBINDIR@/resolvconf -D "$pdnsd_zones" | @SBINDIR@/resolvconf -D "$pdnsd_zones" | ||||
| fi | fi | ||||
| if [ ! -f "$pdns_zones" ] || \ | if [ ! -f "$pdns_zones" ] || \ | ||||
| [ "$(cat "$pdns_zones")" != "$(printf %s "$newzones")" ] | [ "$(cat "$pdns_zones")" != "$(printf %s "$newzones")" ] | ||||
| then | then | ||||
| Show All 10 Lines | |||||