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__":