Created
October 6, 2014 21:15
-
-
Save agarzon/37b6eac3f31a5017ffb2 to your computer and use it in GitHub Desktop.
Plesk, DNS Bulk Apply Settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ADMIN_PASS=`cat /etc/psa/.psa.shadow` | |
MYSQL_BIN_D=`grep MYSQL_BIN_D /etc/psa/psa.conf | awk '{print $2}'` | |
PRODUCT_ROOT_D=`grep PRODUCT_ROOT_D /etc/psa/psa.conf | awk '{print $2}'` | |
mysql="${MYSQL_BIN_D}/mysql -N -uadmin -p${ADMIN_PASS} psa" | |
query="select name from domains;" | |
domains=`echo $query | $mysql ` | |
for i in ${domains}; do | |
${PRODUCT_ROOT_D}/bin/dns --off $i | |
${PRODUCT_ROOT_D}/bin/dns --on $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SELECT name FROM dns_zone WHERE id > 1 AND status = 0
Might be a more reliable query, as you don't want to re-enable DNS for domains for which it was disabled already.