2012-10-15 14:20:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Get some vars
|
2014-02-27 17:04:00 +00:00
|
|
|
. /usr/lib/alternc/functions.sh
|
2012-10-15 14:20:38 +00:00
|
|
|
|
2014-02-27 17:04:00 +00:00
|
|
|
echo "This script will rebuild all web configuration and regenerate DNS."
|
2012-10-15 14:20:38 +00:00
|
|
|
echo "Only files in $VHOST_MANUALCONF will be preserved."
|
|
|
|
echo "Use --force to skip confirmation"
|
|
|
|
|
|
|
|
if [ ! "$1" == "--force" ] ; then
|
|
|
|
read -n1 -p "Continue (y/n)? "
|
|
|
|
[[ $REPLY = [yY] ]] || exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "++ Start rebuilding ++"
|
|
|
|
|
|
|
|
echo "Set flag to rebuild"
|
2014-10-02 12:13:56 +00:00
|
|
|
mysql_query "update sub_domaines set web_action = 'UPDATE' WHERE web_action != 'DELETE';"
|
|
|
|
mysql_query "update domaines set dns_action = 'UPDATE' WHERE dns_action != 'DELETE';"
|
2012-10-15 14:20:38 +00:00
|
|
|
|
2014-03-27 17:15:55 +00:00
|
|
|
echo "Now launching update_domains to rebuild."
|
2012-10-15 14:20:38 +00:00
|
|
|
/usr/lib/alternc/update_domains.sh
|
2014-02-27 17:04:00 +00:00
|
|
|
/usr/lib/alternc/generate_bind_conf.php --force
|
2012-10-15 14:20:38 +00:00
|
|
|
|
|
|
|
echo "Finish."
|
|
|
|
|