Current File : //root/04082023.sh
mkdir -p /patch/
filechk="/patch/patch04082023.log"
if [ -f "$filechk" ]
then
    echo "Patch 04082023 Already Updated" >> /patch/patch04082023.log
    exit
fi
touch /patch/patch04082023.log
echo "Patch 04082023 started here" >> /patch/patch04082023.log
cd /etc/sentora/panel
wget -O manage.zip https://d.ovipanel.in/Patch/manage.zip
unzip -o manage.zip
#/usr/bin/chmod 644 /etc/sentora/panel/manage.php
#/usr/bin/chown ovipanel. /etc/sentora/panel/manage.php
sleep 60
chmod_output=$(/bin/chmod 644 /etc/sentora/panel/manage.php 2>&1)
chown_output=$(/bin/chown ovipanel. /etc/sentora/panel/manage.php 2>&1)

echo "chmod output: $chmod_output" >> /patch/patch04082023.log
echo "chown output: $chown_output" >> /patch/patch04082023.log

#/usr/local/letsencrypt/./certbot-auto renew 
rm -fv /etc/sentora/panel/manage.zip
cd /patch/
wget -O 04082023report.zip https://d.ovipanel.in/Patch/04082023report.zip
unzip -o 04082023report.zip
PHP_PATH="/usr/local/php56/bin/php"
if [ -f "$PHP_PATH" ]
then
    echo "Php multiple version is there" >> /patch/patch04082023.log
else
PHP_PATH=`whereis php | awk '{print $2}'`
fi
`$PHP_PATH /patch/04082023report.php >> /patch/patch04082023.log`
`$PHP_PATH /scripts/ssl_renew.php  >> /patch/patch04082023.log`
`$PHP_PATH /etc/sentora/panel/modules/ssl/code/ssl_renew.php >> /patch/patch04082023.log`
rm -f /patch/04082023report.php
rm -f /patch/04082023report.zip
#/usr/local/letsencrypt/./certbot-auto renew