Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../proc/self/root/opt/maint/bin
File: dns_clean.sh
#!/bin/bash
[0] Fix | Delete
# Simple maintenance script to clean orphaned DNS zones on the local server
[1] Fix | Delete
# Written by Erik S. (e@inmotion.net / ext 834)
[2] Fix | Delete
[3] Fix | Delete
# cron config appends stdout/err to /var/log/maint/dnsclean.log
[4] Fix | Delete
[5] Fix | Delete
shopt -s nullglob
[6] Fix | Delete
[7] Fix | Delete
cd /var/named || exit
[8] Fix | Delete
for zone_file in *.db
[9] Fix | Delete
do domain=$(sed 's/.db$//' <<< "$zone_file")
[10] Fix | Delete
check_dom_owner=$(/scripts/whoowns "$domain")
[11] Fix | Delete
[12] Fix | Delete
if [ "$check_dom_owner" == "" ]; then
[13] Fix | Delete
echo "$(date "+%D %T"): $domain has no owner, auto-cleaning zone file: $zone_file"
[14] Fix | Delete
rm -f "/var/named/$domain.db"
[15] Fix | Delete
sed -e "/^zone \"$domain\"/,+4 d" -i /etc/named.conf
[16] Fix | Delete
fi
[17] Fix | Delete
[18] Fix | Delete
done
[19] Fix | Delete
[20] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function