Explorar el Código

in case there is no conf

Serghey Rodin hace 7 años
padre
commit
0d9218e9fc
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      func/domain.sh

+ 4 - 2
func/domain.sh

@@ -285,8 +285,10 @@ del_web_config() {
         if [[ "$2" =~ stpl$ ]]; then
         if [[ "$2" =~ stpl$ ]]; then
             conf="$HOMEDIR/$user/conf/web/s$1.conf"
             conf="$HOMEDIR/$user/conf/web/s$1.conf"
         fi
         fi
-        get_web_config_lines $WEBTPL/$1/$WEB_BACKEND/$2 $conf
-        sed -i "$top_line,$bottom_line d" $conf
+        if [ -e "$conf" ]; then
+            get_web_config_lines $WEBTPL/$1/$WEB_BACKEND/$2 $conf
+            sed -i "$top_line,$bottom_line d" $conf
+        fi
     fi
     fi
     # clean-up for both config styles if there is no more domains
     # clean-up for both config styles if there is no more domains
     web_domain=$(grep DOMAIN $USER_DATA/web.conf |wc -l)
     web_domain=$(grep DOMAIN $USER_DATA/web.conf |wc -l)