This commit is contained in:
gauthiier 2018-11-28 10:21:43 +01:00
parent de5d7e9a5a
commit f21dc3fe27

View File

@ -104,6 +104,21 @@ def vhost_add(domain):
def vhost_remove(domain):
print(" removing domain — " + domain)
vhost_conf_file = os.path.join('/etc/apache2/sites-available/', domain + '.conf')
if os.path.exists(vhost_conf_file):
if y_n_question("Delete " + vhost_conf_file + " ?"):
subprocess.call(['sudo', 'rm', vhost_conf_file])
www = os.path.join(html_dir_path, domain)
if os.path.exists(www):
if y_n_question("Delete " + www + " ?"):
subprocess.call(['sudo', 'rm', '-r', www])
logs = os.path.join(logs_dir_path, domain)
if os.path.exists(logs):
if y_n_question("Delete " + logs + " ?"):
subprocess.call(['sudo', 'rm', '-r', logs])
if __name__ == "__main__":