-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathuninstall.sh
executable file
·127 lines (102 loc) · 3.62 KB
/
uninstall.sh
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
PACKSRC=`pwd`
#################################################
# cPanel Specific #
#################################################
# Register installed hooks
/usr/local/cpanel/bin/manage_hooks delete module CGPro::Hooks
# iPhone provisioning using default httpd
rm -rf /usr/local/apache/htdocs/iOS
rm -rf /var/CommuniGate/apple
# Uninstall the WHM plugins (administration and groupware control)
if [ `ls /var/cpanel/apps/addon_cgpro*.conf | wc -l` -gt 0 ]
then
chmod +x ${PACKSRC}/scripts/unregister_apps.sh
${PACKSRC}/scripts/unregister_apps.sh
fi
rm -rf /usr/local/cpanel/whostmgr/docroot/cgi/addon_cgpro*
rm -f /usr/local/cpanel/whostmgr/docroot/templates/addon_cgpro_*
# Uninstall CGP Logo
rm -f /usr/local/cpanel/whostmgr/docroot/images/communigate.gif
# Uninstall the WHM Script hooks (CommuniGate provisioning)
if [ -f /usr/local/cpanel/scripts/postwwwacct ]
then
rm -f /usr/local/cpanel/scripts/postwwwacct
fi
# Uninstall cPanel CommuniGate Custom Module
rm -f /usr/local/cpanel/Cpanel/CommuniGate.pm
rm -f /usr/local/cpanel/perl/CLI.pm
rm -f /usr/local/cpanel/CLI.pm
PERL_VERSION=`perl -v | grep 'This is perl' | perl -pe 's/^.*?v(\d+\.\d+\.\d+).*?$/$1/g'`
MY_PERL_PATHS="/usr/local/lib/perl5/$PERL_VERSION /usr/local/lib/perl/$PERL_VERSION /usr/local/share/perl/$PERL_VERSION /usr/local/share/perl5"
DEFAULT_PERL_PATHS=`perl -e "print join ' ', @INC"`
PERL_PATH=""
found=
for i in ${MY_PERL_PATHS[@]}; do
for j in ${DEFAULT_PERL_PATHS[@]}; do
[[ $i == $j ]] && { PERL_PATH=$i; found=1; break; }
done
[[ -n $skip ]] && { break; }
done
if [ ! -d $PERL_PATH ]
then
mkdir -p $PERL_PATH
fi
rm -f /usr/local/cpanel/perl/CLI.pm $PERL_PATH/
rm -f /usr/local/cpanel/XIMSS.pm
# CGPro cPanel Wrapper
rm -f /usr/local/cpanel/bin/ccaadmin
rm -f /usr/local/cpanel/bin/ccawrap
rm -rf /usr/local/cpanel/bin/admin/CGPro
# Uninstall cPanel Function hooks
rm -rf /var/cpanel/perl5/lib/CGPro/
#Uninstall config file
rm -f /var/cpanel/communigate.yaml
rm -f /var/cpanel/cgpro/classes.yaml
# Uninstall CommuniGate Webmail in cPanel
rm -f /var/cpanel/webmail/webmail_communigate*
rm -rf /usr/local/cpanel/base/3rdparty/CommuniGate*
# Uninstall SSO for Webmail
rm -f /var/CommuniGate/cgi/login.pl
# chkservd for CGServer & spamd
rm -f /etc/chkserv.d/CommuniGate
rm -f /etc/chkserv.d/CommuniGate_spamd
sed -i -e '/^CommuniGate/d' /etc/chkserv.d/chkservd.conf
# Uninstall CommuniGate Plugin
BASEDIR='/usr/local/cpanel/base/frontend';
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
LOCALES=($(find ${PACKSRC}/locale -maxdepth 1 -mindepth 1))
IFS=$OLDIFS
lLen=${#LOCALES[@]}
rm -rf ${BASEDIR}/x3/cgpro
rm -f ${BASEDIR}/x3/branding/cgpro_*
rm -rf ${BASEDIR}/x3/dynamicui/dynamicui_cgpro.conf
rm -f ${BASEDIR}/x3/js2-min/cgpro/mail
rmdir ${BASEDIR}/x3/js2-min/cgpro
rm -f ${BASEDIR}/x3/css2-min/cgpro/mail
rmdir ${BASEDIR}/x3/css2-min/cgpro
# END x3
# Start paper_lantern
rm -rf ${BASEDIR}/paper_lantern/cgpro
rm -f ${BASEDIR}/paper_lantern/styled/basic/icons/cgpro_*
rm -rf ${BASEDIR}/paper_lantern/dynamicui/dynamicui_cgpro*.conf
rm -f ${BASEDIR}/paper_lantern/js2-min/cgpro/mail
rmdir ${BASEDIR}/paper_lantern/js2-min/cgpro
rm -f ${BASEDIR}/paper_lantern/css2-min/cgpro/mail
rmdir ${BASEDIR}/paper_lantern/css2-min/cgpro
# END paper_lantern
# Uninstall CommuniGate Plugin Webmail
BASEDIR='/usr/local/cpanel/base/webmail';
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
THEMES=($(find ${BASEDIR} -maxdepth 1 -mindepth 1 -type d))
IFS=$OLDIFS
for (( i=0; i<${tLen}; i++ ));
do
rm -rf ${THEMES[$i]}/cgpro
done
# Update Feature List
rm -f /usr/local/cpanel/whostmgr/addonfeatures/cgpro
/usr/local/cpanel/bin/rebuild_sprites
/usr/local/cpanel/bin/build_locale_databases