Browse Source

Make sure awstats symlink points to the correct config file

Fixes #596
Robert Zollner 6 years ago
parent
commit
ae754f987c
1 changed files with 4 additions and 3 deletions
  1. 4 3
      func/rebuild.sh

+ 4 - 3
func/rebuild.sh

@@ -278,10 +278,11 @@ rebuild_web_domain_conf() {
                 -e "s|%alias_idn%|${aliases_idn//,/ }|g" \
                 > $HOMEDIR/$user/conf/web/$domain/$STATS.conf
         if [ "$STATS" == 'awstats' ]; then
-            if [ ! -e "/etc/awstats/$STATS.$domain_idn.conf" ]; then
-                ln -f -s $HOMEDIR/$user/conf/web/$domain/$STATS.conf \
-                    /etc/awstats/$STATS.$domain_idn.conf
+            if [ -e "/etc/awstats/$STATS.$domain_idn.conf" ]; then
+                rm -f "/etc/awstats/$STATS.$domain_idn.conf"
             fi
+            ln -f -s $HOMEDIR/$user/conf/web/$domain/$STATS.conf \
+                /etc/awstats/$STATS.$domain_idn.conf
         fi
 
         webstats="$BIN/v-update-web-domain-stat $user $domain"