Просмотр исходного кода

Merge pull request #1037 from Lupul/fix-200731

Fix-200731
Raphael Schneeberger 5 лет назад
Родитель
Сommit
794d9f0c53
2 измененных файлов с 5 добавлено и 2 удалено
  1. 3 1
      bin/v-add-firewall-ipset
  2. 2 1
      bin/v-add-letsencrypt-host

+ 3 - 1
bin/v-add-firewall-ipset

@@ -89,7 +89,9 @@ if [ ! -f "${IPSET_PATH}/${IPSET_FILE}.iplist" ] || [ "$force" = "yes" ]; then
         # Advanced: execute script with the same basename for aditional pre-processing
         # ex: 
         if [ -x "${IPSET_PATH}/${IPSET_FILE}.sh" ]; then 
-            setpriv --clear-groups --reuid nobody --regid nogroup -- ${IPSET_PATH}/${IPSET_FILE}.sh "$ip_name" "$iplist_tempfile"
+            preprocess_output="$(cat "$iplist_tempfile" | setpriv --clear-groups --reuid nobody --regid nogroup -- ${IPSET_PATH}/${IPSET_FILE}.sh "$ip_name" "$iplist_tempfile")"
+            check_result $? "Preprocessing script failed (${IPSET_FILE}.sh)"
+            [[ "$preprocess_output" ]] && echo "$preprocess_output" > "$iplist_tempfile"
         fi
 
     elif [[ "$data_source" =~ ^script:/ ]]; then

+ 2 - 1
bin/v-add-letsencrypt-host

@@ -11,8 +11,9 @@
 #----------------------------------------------------------#
 
 # Argument definition
-user="admin"
 domain=$HOSTNAME
+user="$($HESTIA/bin/v-search-domain-owner "$domain" web)"
+[[ -z "$user" ]] && user="admin"
 
 # Includes
 source $HESTIA/func/main.sh