Skip to content

Commit

Permalink
Install & config tools/csfcsf.sh auto cronjob by default in 123.09beta01
Browse files Browse the repository at this point in the history
For fresh Centmin Mod 123.09beta01 and newer initial installs automatically configure /usr/local/src/centminmod/tools/csfcf.sh auto cronjob to update Cloudflare IP whitelisting in CSF Firewall instead of relying on folks to manually do it https://community.centminmod.com/threads/6241/. This has no harm or ill effects for folks who do not use Cloudflare anyway so might as well set it up by default and save folks one extra manual step for each Centmin Mod installation. You can verify it's properly setup cronjob via SSH command listing your cronjobs via:

crontab -l
  • Loading branch information
centminmod committed Mar 6, 2020
1 parent 9e5afa5 commit 8b0888c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion centmin.sh
Expand Up @@ -27,7 +27,7 @@ DT=$(date +"%d%m%y-%H%M%S")
branchname='123.09beta01'
SCRIPT_MAJORVER='1.2.3'
SCRIPT_MINORVER='09'
SCRIPT_INCREMENTVER='449'
SCRIPT_INCREMENTVER='450'
SCRIPT_VERSIONSHORT="${branchname}"
SCRIPT_VERSION="${SCRIPT_VERSIONSHORT}.b${SCRIPT_INCREMENTVER}"
SCRIPT_DATE='29/02/2020'
Expand Down Expand Up @@ -2212,6 +2212,9 @@ incmemcachedinstall
echo "csfinstalls"
csfinstalls

echo "csfcron_setup"
csfcron_setup

echo "siegeinstall"
siegeinstall

Expand Down
12 changes: 12 additions & 0 deletions inc/csfinstall.inc
@@ -1,3 +1,15 @@
csfcron_setup() {
if [[ -f /usr/local/src/centminmod/tools/csfcf.sh && -f /etc/csf/csf.conf && "$(csf -l >/dev/null 2>&1; echo $?)" -eq '0' ]]; then
# if CSF Firewall exists and running ensure Cloudflare IP updater cronjob
# is setup and whitelisted in CSF Firewall for new Centmin Mod initial installs
# https://community.centminmod.com/threads/6241/
crontab -l > cronjoblist
sed -i '/csfcf.sh/d' cronjoblist
echo "22 */12 * * * /usr/local/src/centminmod/tools/csfcf.sh auto >/dev/null 2>&1" >> cronjoblist
crontab cronjoblist
fi
}

csf_maxmind_geolite_two_download() {
csf_maxmind_silent=$1
if [[ -f /etc/csf/csf.conf && -d /var/lib/csf/ ]] && [[ ! -f /var/lib/csf/Geo/GeoLite2-Country-Blocks-IPv4.csv || ! -f /var/lib/csf/Geo/GeoLite2-Country-Blocks-IPv6.csv || ! -f GeoLite2-Country-Locations-en.csv ]]; then
Expand Down

0 comments on commit 8b0888c

Please sign in to comment.