Current File : //root/csfandtlspatch.sh
log_file="/etc/sentora/panel/.PatchCSFandTLS.log"
if [ -f "$log_file" ]
then
    echo "Patch Already Updated."
        exit
else
    `touch $log_file`
fi

echo "SSL TLS Start" >> $log_file
`yes | cp /scripts/tls.sh /scripts/tls.sh_bk`
`echo "TLS Install" > /scripts/tls.sh`
`sed -i '/SslTlsInstallation/d' /var/spool/cron/root`
echo "SSL TLS End" >> $log_file
echo "*******CSF Config Start*******" >> $log_file
currentDate=`date`
echo $currentDate >> $log_file
service_service=`whereis service | awk '{print $2}'`
echo $service_service

file='/etc/csf/csf.conf'
`sed -i '/MESSENGER = "0"/c\MESSENGER = "1"' $file`
`sed -i 's/^\(MESSENGER_HTML_IN\).*/\1 = "80,2082,2095,2086,8080,443" /' $file`
`sed -i 's/^\(MESSENGER_HTTPS_IN\).*/\1 = "443" /' $file`
csf -s /bin/false
CSF_PATH=`whereis csf | awk '{print $2}'`
$CSF_PATH -e
$CSF_PATH -r
`$service_service lfd restart`
`$service_service csf restart`
`sed -i 's/#Banner none/Banner \/etc\/banner.txt/g' /etc/ssh/sshd_config`
`touch /etc/banner.txt`
`echo "If you tried more than 5 times with incorrect login credentials." >> /etc/banner.txt`
`echo "Your ISDN IP will be blacklisted in Firewall." >> /etc/banner.txt`
`$service_service sshd restart`
`sed -i '/#DisplayLogin/c\DisplayLogin            \/etc\/welcome.msg' /etc/proftpd.conf`
`touch /etc/welcome.msg`
`echo "If you tried more than 5 times with incorrect login credentials." >> /etc/welcome.msg`
`echo "Your ISDN IP will be blacklisted in Firewall." >> /etc/welcome.msg`

echo "*******CSF Config End*******" >> $log_file