Current File : //root/patch01102021.sh.1 |
#!/bin/bash
mkdir -p /patch/
filechk="/patch/patch01102021.log"
if [ -f "$filechk" ]
then
echo "Patch 01102021 Already Updated" >> $filechk
exit
fi
touch $filechk
echo "Patch Initiated Start - 01102021 " >> $filechk
filechk_panel="/etc/sentora/panel/version.txt"
if [ -f "$filechk_panel" ]
then
echo "Patch Initiated Start - 01102021 " >> $filechk
/usr/bin/yum -y update ca-certificates >> $filechk
update-ca-trust extract >> $filechk
LSOF_LIB=`whereis lsof | awk '{print $2}'`
PORTEIGHTY=`$LSOF_LIB -i tcp:80 | awk '{print$1}' | awk 'END{print}'`
if [[ $PORTEIGHTY = "" ]]
then
echo "No one running on the port 80"
else
#################### restart portion start ################
echo "restart started" >> $filechk
/usr/sbin/service httpd restart
#################### restart portion end ##################
fi
fi