@@ -267,10 +267,39 @@ add_web_config() {
267267 if [[ " $2 " =~ stpl$ ]]; then
268268 rm -f /etc/$1 /conf.d/domains/$domain .ssl.conf
269269 ln -s $conf /etc/$1 /conf.d/domains/$domain .ssl.conf
270+
271+ # Rename/Move extra SSL config files
272+ for f in $( ls $HOMEDIR /$user /conf/web/* .$domain .conf* 2> /dev/null) ; do
273+ if [[ $f =~ .* /s(nginx| apache2)\. $domain \. conf(.* ) ]]; then
274+ ServerType=" ${BASH_REMATCH[1]} "
275+ CustomConfigName=" ${BASH_REMATCH[2]} "
276+ if [ " $CustomConfigName " = " _letsencrypt" ]; then
277+ rm -f " $f "
278+ continue
279+ fi
280+ mv " $f " " $HOMEDIR /$user /conf/web/$domain /$ServerType .ssl.conf_old$CustomConfigName "
281+ fi
282+ done
270283 else
271284 rm -f /etc/$1 /conf.d/domains/$domain .conf
272285 ln -s $conf /etc/$1 /conf.d/domains/$domain .conf
273- fi
286+
287+ # Rename/Move extra config files
288+ for f in $( ls $HOMEDIR /$user /conf/web/* .$domain .conf* 2> /dev/null) ; do
289+ if [[ $f =~ .* /(nginx| apache2)\. $domain \. conf(.* ) ]]; then
290+ ServerType=" ${BASH_REMATCH[1]} "
291+ CustomConfigName=" ${BASH_REMATCH[2]} "
292+ if [ " $CustomConfigName " = " _letsencrypt" ]; then
293+ rm -f " $f "
294+ continue
295+ fi
296+ mv " $f " " $HOMEDIR /$user /conf/web/$domain /$ServerType .conf_old$CustomConfigName "
297+ elif [[ $f =~ .* /forcessl\. (nginx| apache2)\. $domain \. conf ]]; then
298+ ServerType=" ${BASH_REMATCH[1]} "
299+ mv " $f " " $HOMEDIR /$user /conf/web/$domain /$ServerType .forcessl.conf"
300+ fi
301+ done
302+ fi
274303
275304 trigger=" ${2/ .* pl/ .sh} "
276305 if [ -x " ${WEBTPL_LOCATION} /$trigger " ]; then
0 commit comments