Ignore:
Timestamp:
03/07/11 11:09:20 (3 years ago)
Author:
fufroma
Message:

Reload allégé

File:
1 edited

Legend:

Unmodified
Added
Removed
  • alternc/trunk/src/alternc_reload

    r2855 r2867  
    4242 
    4343if [ `whoami` = 'root' ]; then 
    44     sudo="env" 
     44  sudo="env" 
    4545else 
    46     sudo="sudo" 
     46  sudo="sudo" 
    4747fi 
     48 
     49function apache_reload() { 
     50  if [ -x /usr/sbin/apache2ctl ]; then 
     51    $sudo /usr/sbin/apache2ctl graceful > /dev/null || echo "Cannot restart apache" >> "$DOMAIN_LOG_FILE" 
     52  fi 
     53} 
    4854 
    4955RELOAD_ZONES="$*" 
    5056 
    5157if [ ! -z "$RELOAD_ZONES" ]; then 
    52     if [ "$RELOAD_ZONES" = "all" ]; then 
     58  for zone in $RELOAD_ZONES; do 
     59    case $zone in 
     60      "all") 
    5361        $sudo rndc reload > /dev/null || echo "Cannot reload bind" >> "$DOMAIN_LOG_FILE" 
    54     else 
    55         for zone in $RELOAD_ZONES; do 
    56             $sudo rndc reload "$zone" > /dev/null || echo "Cannot reload bind for zone $zone" >> "$DOMAIN_LOG_FILE" 
    57         done 
    58     fi 
    59     if [ -x /usr/sbin/apache2ctl ]; then 
    60         $sudo /usr/sbin/apache2ctl graceful > /dev/null || echo "Cannot restart apache" >> "$DOMAIN_LOG_FILE" 
    61     fi 
     62        apache_reload # keep for compatibility 
     63        ;; 
     64      "apache") 
     65        apache_reload 
     66        ;; 
     67      *) 
     68        $sudo rndc reload "$zone" > /dev/null || echo "Cannot reload bind for zone $zone" >> "$DOMAIN_LOG_FILE" 
     69        ;; 
     70    esac 
     71  done 
    6272fi 
     73 
Note: See TracChangeset for help on using the changeset viewer.