-
Notifications
You must be signed in to change notification settings - Fork 3
/
uninstall-softaculous
68 lines (68 loc) · 3.33 KB
/
uninstall-softaculous
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# This uninstalls Softaculous for you in cPanel, Plesk and DirectAdmin servers.
printf "Softaculous Uninstaller by Keiro v0.2. WTFPL - http://www.wtfpl.net \\n"
printf "Improvements and suggestions, e-mail [email protected] \\n"
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar <[email protected]>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
# 0. You just DO WHAT THE FUCK YOU WANT TO.
# Check for root.
# Am I root?
if [ "x$(id -u)" != 'x0' ]; then
echo -e "Error: this script can only be executed by root!"
exit 1
fi
# Detect what we're on and display to user.
echo "Detecting control panels..."
# Let's check and make sure we're on cPanel, DA or Plesk first...
if [[ -d /usr/local/psa ]];then
panel="Plesk"
elif [[ -d /usr/local/cpanel ]];then
panel="cP"
elif [[ -d /usr/local/directadmin ]];then
panel="DA"
elif [[ -d /usr/local/interworx ]];then
panel="IW"
else
panel="none"
fi
#echo "The uninstaller's not quite automatic yet but will be in a future iteration."
#echo "For now, please select the uninstaller for the control panel you're on."
# Whoo. No need for asking us to select control panels. It'll auto-detect!
# Execute uninstallers.
if [[ $panel == "cP" ]];then
echo "cPanel detected! Uninstalling..."
# Unregister the cPanel plugin...
/usr/local/cpanel/bin/unregister_cpanelplugin /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/softaculous.cpanelplugin;
# Do the thang.
rm -rf /etc/cron.d/softaculous*; rm -rf /var/softaculous; rm -rf /usr/local/cpanel/whostmgr/cgi/softaculous; rm -rf /usr/local/cpanel/cgi/addon_softaculous.*; rm -rf /usr/local/cpanel/base/frontend/x3/dynamicui/dynamicui_softicons.conf; rm -rf /usr/local/cpanel/base/frontend/x3/dynamicui/dynamicui_softaculous.conf; rm -rf /usr/local/cpanel/base/frontend/x3/dynamicui/dynamicui_soft_div_icons.conf; rm -rf /usr/local/cpanel/base/frontend/x3/dynamicui/dynamicui_soft_div.conf; rm -rf /usr/local/cpanel/base/frontend/paper_lantern/dynamicui/dynamicui_softicons.conf; rm -rf /usr/local/cpanel/base/frontend/paper_lantern/dynamicui/dynamicui_softaculous.conf; rm -rf /usr/local/cpanel/base/frontend/paper_lantern/dynamicui/dynamicui_soft_div_icons.conf; rm -rf /usr/local/cpanel/base/frontend/paper_lantern/dynamicui/dynamicui_soft_div.conf;
fi
# Actually remove Softaculous from DA.
if [[ $panel == "DA" ]];then
echo "DirectAdmin detected! Uninstalling..."
# Do the thang.
rm -rf /etc/cron.d/softaculous; rm -rf /etc/cron.d/softaculous2; rm -rf /var/softaculous; rm -rf /usr/local/directadmin/plugins/softaculous;
fi
if [[ $panel == "Plesk" ]];then
echo "Plesk detected! Uninstalling..."
# Do the thang.
rm -rf /etc/cron.d/softaculous; rm -rf /etc/cron.d/softaculous2; rm -rf /var/softaculous; rm -rf /usr/local/psa/admin/htdocs/modules/softaculous; rm -rf /usr/local/softaculous;
fi
if [[ $panel == "IW" ]];then
echo "InterWorx detected! Uninstalling..."
fi
if [[ $panel == "none" ]];then
echo "Dude, this server has no control panel. Aborting!" || exit 1;
fi
# Finish up.
echo "Removal of Softaculous is complete!"