mesranet

Well-Known Member
May 6, 2002
133
0
316
Hi,

I just upgrade all my server php default to 7.3 instead of 5.6, since that i receive many complain of error 500 on some of client website, so now i'm looking a script to check all domain i have so i can check which account are having issue with php 7.3 and i can switch to 5.6 by using .htaccess

Any script out there can do the job ? Please advice.

TQ
 

dalem

Well-Known Member
PartnerNOC
Oct 24, 2003
2,977
155
368
SLC
cPanel Access Level
DataCenter Provider
Something like this (if you want the output to print to a file just a add > filename while calling the script
Proabaly be improved but created this real quick

Code:
#!/bin/bash

mkdir /home/activedomains
cd /home/activedomains
cat /etc/userdomains | cut -d ':' -f 1 |  awk '{ print $1}'> /home/activedomains/activedomains.txt
for i in `cat /home/activedomains/activedomains.txt`
do
echo $i ; curl --connect-timeout 3  --write-out "%{http_code}\n" --silent --output /dev/null ${i}
done