File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -375,12 +375,19 @@ if [ "$web" != 'no' ] && [ ! -z "$WEB_SYSTEM" ]; then
375375
376376 # Copying SSL certificates
377377 if [ " $SSL " = ' yes' ]; then
378- certificates=$( ls $tmpdir /web/$domain /conf| grep ssl)
379- certificates=$( echo " $certificates " | grep $domain )
380- for crt in $certificates ; do
381- crt=$( echo $crt | sed -e " s/ssl.//" )
382- cp -f $tmpdir /web/$domain /conf/ssl.$crt $USER_DATA /ssl/$crt
383- done
378+
379+ if [ -f " $tmpdir /web/$domain /$backup_system /$domain .crt" ]; then
380+ for crt in $( ls $tmpdir /web/$domain /$backup_system | grep -E ' ^' $domain ' \.(crt|key|ca|pem)$' ) ; do
381+ cp -f " $tmpdir /web/$domain /$backup_system /$crt " " $USER_DATA /ssl/"
382+ done
383+ elif [ -f " $tmpdir /web/$domain /conf/ssl.$domain .crt" ]; then
384+ certificates=$( ls $tmpdir /web/$domain /conf| grep ssl)
385+ certificates=$( echo " $certificates " | grep $domain )
386+ for crt in $certificates ; do
387+ crt=$( echo $crt | sed -e " s/ssl.//" )
388+ cp -f $tmpdir /web/$domain /conf/ssl.$crt $USER_DATA /ssl/$crt
389+ done
390+ fi
384391 fi
385392
386393 # Merging web.conf keys
You can’t perform that action at this time.
0 commit comments