Skip to content

Commit ec70dd5

Browse files
unknownunknown
authored andcommitted
Confirm uninstall
1 parent b07d3f5 commit ec70dd5

File tree

1 file changed

+37
-31
lines changed

1 file changed

+37
-31
lines changed

install/uninstall.php

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434

3535
error_reporting(E_ALL|E_STRICT);
3636

37+
require_once "/usr/local/ispconfig/server/lib/config.inc.php";
38+
require_once "/usr/local/ispconfig/server/lib/app.inc.php";
39+
3740
//** The banner on the command line
3841
echo "\n\n".str_repeat('-', 80)."\n";
3942
echo " _____ ___________ _____ __ _ ____
@@ -47,36 +50,39 @@
4750
echo "\n".str_repeat('-', 80)."\n";
4851
echo "\n\n>> Uninstall \n\n";
4952

50-
require "/usr/local/ispconfig/server/lib/config.inc.php";
51-
require "/usr/local/ispconfig/server/lib/app.inc.php";
52-
53-
// Delete the ISPConfig database
54-
// $app->db->query("DROP DATABASE '".$conf["db_database"]."'");
55-
// $app->db->query("DELETE FROM mysql.user WHERE User = 'ispconfig'");
56-
57-
58-
exec("/etc/init.d/mysql stop");
59-
exec("rm -rf /var/lib/mysql/".$conf["db_database"]);
60-
exec("/etc/init.d/mysql start");
61-
62-
// Deleting the symlink in /var/www
63-
// Apache
64-
@unlink("/etc/apache2/sites-enabled/000-ispconfig.vhost");
65-
@unlink("/etc/apache2/sites-available/ispconfig.vhost");
66-
@unlink("/etc/apache2/sites-enabled/000-apps.vhost");
67-
@unlink("/etc/apache2/sites-available/apps.vhost");
68-
69-
// nginx
70-
@unlink("/etc/nginx/sites-enabled/000-ispconfig.vhost");
71-
@unlink("/etc/nginx/sites-available/ispconfig.vhost");
72-
@unlink("/etc/nginx/sites-enabled/000-apps.vhost");
73-
@unlink("/etc/nginx/sites-available/apps.vhost");
74-
75-
// Delete the ispconfig files
76-
exec('rm -rf /usr/local/ispconfig');
77-
78-
echo "Please do not forget to delete the ispconfig user in the mysql.user table.\n\n";
79-
80-
echo "Finished.\n";
53+
$do_uninstall = $inst->simple_query('Are you sure you want to uninsatll ISPConfig?', array('yes', 'no'), 'no');
54+
if($do_uninstall == 'yes') {
55+
56+
57+
// Delete the ISPConfig database
58+
// $app->db->query("DROP DATABASE '".$conf["db_database"]."'");
59+
// $app->db->query("DELETE FROM mysql.user WHERE User = 'ispconfig'");
60+
61+
62+
exec("/etc/init.d/mysql stop");
63+
exec("rm -rf /var/lib/mysql/".$conf["db_database"]);
64+
exec("/etc/init.d/mysql start");
65+
66+
// Deleting the symlink in /var/www
67+
// Apache
68+
@unlink("/etc/apache2/sites-enabled/000-ispconfig.vhost");
69+
@unlink("/etc/apache2/sites-available/ispconfig.vhost");
70+
@unlink("/etc/apache2/sites-enabled/000-apps.vhost");
71+
@unlink("/etc/apache2/sites-available/apps.vhost");
72+
73+
// nginx
74+
@unlink("/etc/nginx/sites-enabled/000-ispconfig.vhost");
75+
@unlink("/etc/nginx/sites-available/ispconfig.vhost");
76+
@unlink("/etc/nginx/sites-enabled/000-apps.vhost");
77+
@unlink("/etc/nginx/sites-available/apps.vhost");
78+
79+
// Delete the ispconfig files
80+
exec('rm -rf /usr/local/ispconfig');
81+
82+
echo "Please do not forget to delete the ispconfig user in the mysql.user table.\n\n";
83+
84+
echo "Finished.\n";
85+
86+
}
8187

8288
?>

0 commit comments

Comments
 (0)