Added delete flask webapp

This commit is contained in:
absurdo 2023-11-29 23:53:11 +01:00
parent 4f7d88f995
commit 90990ab1c0
10 changed files with 969 additions and 2 deletions

View file

@ -48,10 +48,26 @@ if os.path.isfile(apache_php):
apache_webapp='/etc/{}/vhosts.d/extra/{}-{}.conf'.format(apache_cmd, args.domain, args.webapp)
apache_sub0_webapp='/etc/{}/vhosts.d/extra/{}-000-{}.conf'.format(apache_cmd, args.domain, args.webapp)
apache_sub1_webapp='/etc/{}/vhosts.d/extra/{}-001-{}.conf'.format(apache_cmd, args.domain, args.webapp)
if os.path.isfile(apache_webapp):
if subprocess.call("sudo rm %s" % (apache_webapp), shell=True) > 0:
print('Error: cannot delete webapp config %s' % apache_webapp)
sys.exit(1)
if os.path.isfile(apache_sub0_webapp):
if subprocess.call("sudo rm %s" % (apache_sub0_webapp), shell=True) > 0:
print('Error: cannot delete webapp config %s' % apache_sub0_webapp)
sys.exit(1)
if os.path.isfile(apache_sub1_webapp):
if subprocess.call("sudo rm %s" % (apache_sub1_webapp), shell=True) > 0:
print('Error: cannot delete webapp config %s' % apache_sub1_webapp)
sys.exit(1)
if subprocess.call("sudo systemctl restart %s" % (apache_cmd), shell=True) > 0:
print('Error: cannot restart Apache server')