3 # $Id: update_domaines.sh,v 1.31 2005/08/29 19:21:31 anarcat Exp $
4 # ----------------------------------------------------------------------
5 # AlternC - Web Hosting System
6 # Copyright (C) 2002 by the AlternC Development Team.
8 # ----------------------------------------------------------------------
10 # Valentin Lacambre's web hosting softwares: http://altern.org/
11 # ----------------------------------------------------------------------
14 # This program is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License (GPL)
16 # as published by the Free Software Foundation; either version 2
17 # of the License, or (at your option) any later version.
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
24 # To read the license please visit http://www.gnu.org/copyleft/gpl.html
25 # ----------------------------------------------------------------------
26 # Original Author of file: Jerome Moinet for l'Autre Net - 14/12/2000
27 # Purpose of file: service reloading
28 # ----------------------------------------------------------------------
31 PATH=/sbin:/bin:/usr/sbin:/usr/bin
37 ########################################################################
38 # Constants & Preliminary checks
41 DOMAIN_LOG_FILE="/var/log/alternc/update_domains.log"
42 exec >>"$DOMAIN_LOG_FILE" 2>&1
44 if [ `whoami` = 'root' ]; then
51 if [ -x /usr/sbin/apache2ctl ]; then
52 $sudo /usr/sbin/apache2ctl graceful || echo "Cannot restart apache"
57 if [ -x /etc/init.d/bind9 ]; then
58 $sudo /etc/init.d/bind9 restart || echo "Cannot restart dns daemon (bind9)"
65 if [ ! -z "$RELOAD_ZONES" ]; then
66 for zone in $RELOAD_ZONES; do
69 $sudo rndc reload || echo "Cannot reload bind"
70 apache_reload # keep for compatibility
76 # FIXME: should reload only concerned zones
77 #$sudo rndc reload "$zone" || echo "Cannot reload bind for zone $zone"
78 $sudo rndc reload || echo "Cannot reload bind for zone $zone"