forked from rapyd-cloud/rapyd-vz-support
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrapyd-comodo-installer.sh
41 lines (32 loc) · 1.37 KB
/
rapyd-comodo-installer.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
#!/bin/bash
# must be run as litespeed user
######################################################################################################################
# install Comodo exclude rules
# cleanup any legacy code from previous system
revertCM () {
cd /var/www/conf/comodo_litespeed
targetfile=$1
backupfile=$targetfile".backup"
if [ -f $backupfile ]; then
rm -f $targetfile
cp -f $backupfile $targetfile
rm -f $backupfile
fi
}
revertCM "26_Apps_WordPress.conf"
revertCM "30_Apps_OtherApps.conf"
# install new comodo files
cd /var/www/conf/comodo_litespeed
# always include new version of Rapyd_excludes
rm -f 00_Rapyd_Excludes.conf
wget https://raw.githubusercontent.com/rapyd-cloud/rapyd-vz-support/main/00_Rapyd_Excludes.conf
#only include customer template if it is missing
if [ ! -f "00_Rapyd_Customer_Excludes.conf" ]; then
wget https://raw.githubusercontent.com/rapyd-cloud/rapyd-vz-support/main/00_Rapyd_Customer_Excludes.conf
fi
# add rapyd exclude rules to the master ruleset conf
if [ -f "rules.conf" ]; then
grep -c 00_Rapyd_Customer_Excludes rules.conf || sed -i "1i \Include 00_Rapyd_Customer_Excludes.conf" rules.conf
grep -c 00_Rapyd_Excludes rules.conf || sed -i "1i \Include 00_Rapyd_Excludes.conf" rules.conf
fi
######################################################################################################################