Current File : //root/restartscript221118.sh
chmod +x /usr/bin/setso
HR_VER=`setso --show dbversion`
echo $HR_VER
if [ $HR_VER = "2.7" ] || [ $HR_VER = "2.6" ]
then
		file="/etc/sentora/panel/restartpatch-221118.log"
		if [ -f "$file" ]
		then
			echo "Restart Patch Already Updated"
			exit
		fi
		touch $file
		SERVICE_SERV=`whereis service | awk '{print $2}'`
		APCHECTL_SERV=`whereis apachectl | awk '{print $2}'`
		HTTPD_RESTART=$($APCHECTL_SERV configtest 2>&1)
		echo $HTTPD_RESTART > $file
		HTTPD_SYNTAX=`echo $HTTPD_RESTART | grep -i "Syntax OK"`
		echo $HTTPD_SYNTAX
		if [[ $HTTPD_SYNTAX ]]
		then
			$SERVICE_SERV httpd restart
		else
			echo "There is having the syntax error in apache config. Please check" >> $file
			EMAIL_LOG=1
		fi
		LIGHTTPD_CONFIGTEST=$(lighttpd -t -f /etc/lighttpd/lighttpd.conf 2>&1)
		echo $LIGHTTPD_CONFIGTEST >> $file

		LIGHTTPD_RESTART=`echo $LIGHTTPD_CONFIGTEST | grep -i "Syntax OK"`
		if [[ $LIGHTTPD_RESTART ]]
		then
			$SERVICE_SERV lighttpd restart
		else
			echo "There is having the syntax error in lighttpd config. Please check" >> $file
			EMAIL_LOG=1
		fi
		#if [ $EMAIL_LOG ]
		#then
		#	echo "$file" | mail -s "Error in Config File" support@hostingraja.info
		#else
		#	echo "Updated Successfully" >> $file
		#fi
fi