Skip to content

Commit

Permalink
update dynamic dmotd.sh banner to support 2 new variables in 123.09be…
Browse files Browse the repository at this point in the history
…ta01

[CODEB]
ENABLEMOTD_CSFMSG='y'         # motd banner csf message alert disaply
ENABLEMOTD_LINKSMSG='y'       # motd centminmod.com links bookmark alert display
[/CODEB]

When you log into Centmin Mod 123.09beta01 you get a motd banner with stats and csf firewall warning alert and links to bookmark at centminmod.com. These 2 variables when set in persistent config file /etc/centminmod/custom_config.inc can disable the CSF Firewall and Bookmark links part of the motd banner display.
  • Loading branch information
centminmod committed Sep 15, 2016
1 parent fdf413d commit bf8792c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 14 additions & 2 deletions config/motd/dmotd.sh
Expand Up @@ -14,6 +14,7 @@ RELEASE=$(cat /etc/redhat-release | sed -e 's| (Core)||' -e 's| release||')
PSA=$(ps -Afl | wc -l)
CURRENTUSER=$(users | wc -w)
CMSCRIPT_GITDIR='/usr/local/src/centminmod'
CONFIGSCANBASE='/etc/centminmod'
###########################################################
# Setup Colours
black='\E[30;40m'
Expand Down Expand Up @@ -48,6 +49,11 @@ return
}

###########################################################
if [ -f "${CONFIGSCANBASE}/custom_config.inc" ]; then
# default is at /etc/centminmod/custom_config.inc
source "${CONFIGSCANBASE}/custom_config.inc"
fi

# time of day
HOUR=$(date +"%H")
if [ $HOUR -lt 12 -a $HOUR -ge 0 ]
Expand Down Expand Up @@ -87,19 +93,25 @@ echo "
$MEM
===============================================================================
$DF
===============================================================================
"
if [[ "$ENABLEMOTD_CSFMSG" != [nN] ]]; then
echo "===============================================================================
! This server maybe running CSF Firewall !
DO NOT run the below command or you will lock yourself out of the server:
iptables -F
"
fi
if [[ "$ENABLEMOTD_LINKSMSG" != [nN] ]]; then
echo "
===============================================================================
* Getting Started Guide - http://centminmod.com/getstarted.html
* Centmin Mod FAQ - http://centminmod.com/faq.html
* Change Log - http://centminmod.com/changelog.html
* Community Forums https://community.centminmod.com [ << Register ]
===============================================================================
"
fi
}


Expand Down
3 changes: 3 additions & 0 deletions example/custom_config.inc
Expand Up @@ -13,6 +13,9 @@ PUSHOVER_EMAIL='' # Signup pushover.net push email notifications to mobile & tab
CMGIT='https://github.com/centminmod/centminmod.git'
AUTO_GITUPDATE='n'

ENABLEMOTD_CSFMSG='y' # motd banner csf message alert disaply
ENABLEMOTD_LINKSMSG='y' # motd centminmod.com links bookmark alert display

# Clang & GCC Compilers
CLANG='y' # Nginx and LibreSSL
CLANG_PHP='n' # PHP
Expand Down

0 comments on commit bf8792c

Please sign in to comment.