PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /opt/maint/bin/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //opt/maint/bin/dns_clean.sh

#!/bin/bash
# Simple maintenance script to clean orphaned DNS zones on the local server
# Written by Erik S. (e@inmotion.net / ext 834)

# cron config appends stdout/err to /var/log/maint/dnsclean.log

shopt -s nullglob

cd /var/named || exit
for zone_file in *.db
    do domain=$(sed 's/.db$//' <<< "$zone_file")
    check_dom_owner=$(/scripts/whoowns "$domain")

    if [ "$check_dom_owner" == "" ]; then
        echo "$(date "+%D %T"): $domain has no owner, auto-cleaning zone file: $zone_file"
        rm -f "/var/named/$domain.db"
        sed -e "/^zone \"$domain\"/,+4 d" -i /etc/named.conf
    fi

done