| Server IP : 104.129.129.72 / Your IP : 216.73.216.229 Web Server : LiteSpeed System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 User : answe8064 ( 1002) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /opt/installer/include/ |
Upload File : |
#!/bin/bash
# Add this at the begining of all scripts.
if [ -f "include/startup.sh" ]; then
. include/startup.sh
elif [ -f "../include/startup.sh" ]; then
. ../include/startup.sh
fi
curlBaseParams=(--connect-timeout 10 --retry 3 --retry-connrefused --retry-delay 2 --max-time 30)
domains=(www.cloudwm.com www.google.com www.yahoo.com)
echo "Checking internet connectivity" | log
for domain in "${domains[@]}"; do
echo "Trying to fetch $domain" | log
curl "${curlBaseParams[@]}" --url "http://$domain/" > /dev/null
status=$?
((exitCode+=$status))
if [ $status -ne 0 ]; then
echo "Failed." | log
continue
fi
echo "Succeed." | log
done
if [ $exitCode -ne 0 ]; then
echo "Test didn't pass ${#domains[@]} times. Test Failed. (1)" | log 1
tagScript failed
exit 1
fi
echo "Test passed ${#domains[@]} times. Test Passed. (0)" | log
tagScript success
exit 0