Permet de forcer un regenerate des zones

Refait marcher le rebuild-all-webconf
This commit is contained in:
Alan Garcia 2014-02-27 17:04:00 +00:00
parent 3eecc68a81
commit 35f146eb39
2 changed files with 12 additions and 21 deletions

View File

@ -5,7 +5,7 @@
*
* Generate Bind configuration for AlternC
*
* To force generation, /launch/generate_bind_conf.php force
* To force generation, /launch/generate_bind_conf.php --force
*
*
**/
@ -15,6 +15,10 @@ ini_set("display_errors", 1);
$bind = new system_bind();
//$bind->regenerate_conf(true); // use it to force regeneration
$bind->regenerate_conf();
$force = false;
if (in_array('--force', $argv)) { // Want to force
$force=true;
}
$bind->regenerate_conf($force);

View File

@ -1,15 +1,9 @@
#!/bin/bash
# Get some vars
. /usr/lib/alternc/functions_hosting.sh
. /usr/lib/alternc/functions.sh
if [ -z "$VHOST_DIR" ] ; then
echo "Problem: No VHOST_DIR var"
exit 2
fi
echo "This script empty the $VHOST_DIR directory"
echo "and rebuild all web configuration."
echo "This script will rebuild all web configuration and regenerate DNS."
echo ""
echo "Only files in $VHOST_MANUALCONF will be preserved."
echo "Use --force to skip confirmation"
@ -23,20 +17,13 @@ fi
echo ""
echo "++ Start rebuilding ++"
echo "Delete old configuration"
# [a-z_] for old storage schema (1.0)
for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z _ ; do
test -d "$VHOST_DIR/$i" && rm -rf "$VHOST_DIR/$i/"
done
test -f "$VHOST_FILE" && rm -f "$VHOST_FILE"
echo "Deleting complete"
echo "Set flag to rebuild"
mysql_query "update sub_domaines set web_action = 'UPDATE';"
mysql_query "update domaines set dns_action = 'UPDATE';"
mysql_query "update sub_domaines set web_action = 'UPDATE' and web_action != 'DELETE';"
mysql_query "update domaines set dns_action = 'UPDATE' and dns_action != 'DELETE';"
echo "Launch update_domains to rebuild."
/usr/lib/alternc/update_domains.sh
/usr/lib/alternc/generate_bind_conf.php --force
echo "Finish."