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

creating le pipe in order to avoid std out errors

Serghey Rodin 9 лет назад
Родитель
Сommit
fa4b66f8c7
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      bin/v-add-letsencrypt-domain

+ 6 - 0
bin/v-add-letsencrypt-domain

@@ -51,6 +51,7 @@ get_domain_values 'web'
 # Registering LetsEncrypt user account
 $BIN/v-add-letsencrypt-user $user
 if [ "$?" -ne 0  ]; then
+    touch $VESTA/data/queue/letsencrypt.pipe
     sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
     send_notice "LETSENCRYPT" "Account registration failed"
     check_result $E_CONNECT "LE account registration" >/dev/null
@@ -65,6 +66,7 @@ i=1
 for alias in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
     $BIN/v-check-letsencrypt-domain $user $alias
     if [ "$?" -ne 0 ]; then
+        touch $VESTA/data/queue/letsencrypt.pipe
         sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
         send_notice "LETSENCRYPT" "$alias validation failed"
         check_result $E_INVALID "LE domain validation" >/dev/null
@@ -72,6 +74,7 @@ for alias in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
 
     # Checking LE limits per account
     if [ "$i" -gt 100 ]; then
+        touch $VESTA/data/queue/letsencrypt.pipe
         sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
         send_notice 'LETSENCRYPT' 'Limit of domains per account is reached'
         check_result $E_LIMIT "LE can't sign more than 100 domains"
@@ -86,6 +89,7 @@ ssl_dir=$($BIN/v-generate-ssl-cert "$domain" "$email" "US" "California" \
 # Signing CSR
 crt=$($BIN/v-sign-letsencrypt-csr $user $domain $ssl_dir)
 if [ "$?" -ne 0 ]; then
+    touch $VESTA/data/queue/letsencrypt.pipe
     sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
     send_notice "LETSENCRYPT" "$alias validation failed"
     check_result "$E_INVALID" "LE $domain validation"
@@ -107,6 +111,7 @@ fi
 $BIN/v-delete-web-domain-ssl $user $domain >/dev/null 2>&1
 $BIN/v-add-web-domain-ssl $user $domain $ssl_dir
 if [ "$?" -ne '0' ]; then
+    touch $VESTA/data/queue/letsencrypt.pipe
     sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
     send_notice 'LETSENCRYPT' "$domain certificate installation failed"
     check_result $? "SSL install" >/dev/null
@@ -141,6 +146,7 @@ fi
 send_notice 'LETSENCRYPT' "$domain SSL has been installed successfully"
 
 # Deleteing task from queue
+touch $VESTA/data/queue/letsencrypt.pipe
 sed -i "/ $domain /d" $VESTA/data/queue/letsencrypt.pipe
 
 # Logging