Browse Source

Fix invalid extension replace in add_web_config

Do not use globbing, because it kills too many characters.
Use conditionals and search at the end of the line instead.
Chernyavskiy Leonid 7 years ago
parent
commit
ebc67f6478
1 changed files with 5 additions and 1 deletions
  1. 5 1
      func/domain.sh

+ 5 - 1
func/domain.sh

@@ -215,7 +215,11 @@ add_web_config() {
         fi
         fi
     fi
     fi
 
 
-    trigger="${2/.*pl/.sh}"
+    trigger="${2/%.tpl/.sh}"
+    if [[ "$2" =~ stpl$ ]]; then
+        trigger="${2/%.stpl/.sh}"
+    fi
+
     if [ -x "$WEBTPL/$1/$WEB_BACKEND/$trigger" ]; then
     if [ -x "$WEBTPL/$1/$WEB_BACKEND/$trigger" ]; then
         $WEBTPL/$1/$WEB_BACKEND/$trigger \
         $WEBTPL/$1/$WEB_BACKEND/$trigger \
             $user $domain $local_ip $HOMEDIR \
             $user $domain $local_ip $HOMEDIR \