From f21dc3fe272d1c49e4cfbb13623d6697074555c1 Mon Sep 17 00:00:00 2001 From: gauthiier Date: Wed, 28 Nov 2018 10:21:43 +0100 Subject: [PATCH] vhost --- vhost-apache2/vhost.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/vhost-apache2/vhost.py b/vhost-apache2/vhost.py index 711270e..d4710e7 100755 --- a/vhost-apache2/vhost.py +++ b/vhost-apache2/vhost.py @@ -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__":