@@ -237,12 +237,16 @@ add_web_config() {
237237 rm -f $HOMEDIR /$user /conf/web/$domain .*
238238 rm -f $HOMEDIR /$user /conf/web/ssl.$domain .*
239239
240- # Rename/Move extra SSL nginx config files
241- for f in $( ls $HOMEDIR /$user /conf/web/snginx.$domain .conf* 2> /dev/null) ; do
242- if [[ $f =~ .* /snginx\. $domain \. conf(.* ) ]]; then
243- CustomConfigName=" ${BASH_REMATCH[1]} "
244- echo " Processing SSL $f $user / $PathUser $domain / $PathDomain "
245- mv " $f " " $HOMEDIR /$user /conf/web/$domain /nginx.ssl.conf_old$CustomConfigName "
240+ # Rename/Move extra SSL config files
241+ for f in $( ls $HOMEDIR /$user /conf/web/* .$domain .conf* 2> /dev/null) ; do
242+ if [[ $f =~ .* /s(nginx| apache2)\. $domain \. conf(.* ) ]]; then
243+ ServerType=" ${BASH_REMATCH[1]} "
244+ CustomConfigName=" ${BASH_REMATCH[2]} "
245+ if [ " $CustomConfigName " = " _letsencrypt" ]; then
246+ rm -f " $f "
247+ continue
248+ fi
249+ mv " $f " " $HOMEDIR /$user /conf/web/$domain /$ServerType .ssl.conf_old$CustomConfigName "
246250 fi
247251 done
248252 else
@@ -252,15 +256,19 @@ add_web_config() {
252256 # Clear old configurations
253257 rm -rf $HOMEDIR /$user /conf/web/$domain .*
254258
255- # Rename/Move extra nginx config files
256- for f in $( ls $HOMEDIR /$user /conf/web/nginx.$domain .conf* 2> /dev/null) ; do
257- if [[ $f =~ .* /nginx\. $domain \. conf(.* ) ]]; then
258- CustomConfigName=" ${BASH_REMATCH[1]} "
259- if [ " CustomConfigName" != " _letsencrypt" ]; then
260- CustomConfigName = " _old$CustomConfigName "
259+ # Rename/Move extra config files
260+ for f in $( ls $HOMEDIR /$user /conf/web/* .$domain .conf* 2> /dev/null) ; do
261+ if [[ $f =~ .* /(nginx| apache2)\. $domain \. conf(.* ) ]]; then
262+ ServerType=" ${BASH_REMATCH[1]} "
263+ CustomConfigName=" ${BASH_REMATCH[2]} "
264+ if [ " $CustomConfigName " = " _letsencrypt" ]; then
265+ rm -f " $f "
266+ continue
261267 fi
262- echo " Processing SSL $f $user / $PathUser $domain / $PathDomain "
263- mv " $f " " $HOMEDIR /$user /conf/web/$domain /nginx.conf$CustomConfigName "
268+ mv " $f " " $HOMEDIR /$user /conf/web/$domain /$ServerType .conf_old$CustomConfigName "
269+ elif [[ $f =~ .* /forcessl\. (nginx| apache2)\. $domain \. conf ]]; then
270+ ServerType=" ${BASH_REMATCH[1]} "
271+ mv " $f " " $HOMEDIR /$user /conf/web/$domain /$ServerType .forcessl.conf"
264272 fi
265273 done
266274 fi
0 commit comments