Add config removal

This commit is contained in:
VirtuBox
2019-08-30 08:40:35 +02:00
parent 8e9af7c312
commit eabfa5a7ff
2 changed files with 10 additions and 1 deletions

View File

@@ -1441,8 +1441,13 @@ class WOSiteUpdateController(CementBaseController):
elif data['letsencrypt'] is False:
if pargs.letsencrypt == "off":
if os.path.isfile("{0}/conf/nginx/ssl.conf"
if os.path.islink("{0}/conf/nginx/ssl.conf"
.format(wo_site_webroot)):
WOFileUtils.remove_symlink(self,
"{0}/conf/nginx/ssl.conf"
.format(wo_site_webroot))
elif os.path.isfile("{0}/conf/nginx/ssl.conf"
.format(wo_site_webroot)):
Log.info(self, 'Setting Nginx configuration')
WOFileUtils.mvfile(self, "{0}/conf/nginx/ssl.conf"
.format(wo_site_webroot),

View File

@@ -1270,6 +1270,10 @@ def removeAcmeConf(self, domain):
if os.path.islink('{0}'.format(sslconf)):
# remove broken symlinks
WOFileUtils.remove_symlink(self, symlink)
else:
if os.path.islink("{0}".format(sslconf)):
WOFileUtils.remove_symlink(self, "{0}".format(sslconf))
WOFileUtils.rm(self, '{0}'.format(sslforce))
if WOFileUtils.grepcheck(self, '/var/www/22222/conf/nginx/ssl.conf',
'{0}'.format(domain)):