Re: Debugging CGI

new topic     » goto parent     » topic index » view thread      » older message » newer message

Small improvement in the debug script: no need to show logs if an error happens.

#!/bin/bash 
echo "--------------------------------------------------------------------------------" 
echo "Debug starts at $(date +"%Y-%m-%d %H:%M:%S")" 
echo "--------------------------------------------------------------------------------" 
echo -e "\n/usr/lib/cgi-bin/ex.err" 
if [ -f /usr/lib/cgi-bin/ex.err ] 
then 
  head -20 /usr/lib/cgi-bin/ex.err 
  exit 
else 
  echo "Not found" 
fi 
echo -e "\n/usr/lib/cgi-bin/error.log" 
[ -f /usr/lib/cgi-bin/error.log ] && cat /usr/lib/cgi-bin/error.log || echo "Not found" 
for i in $(ls -1tr log/*) 
do 
 echo -e "\n$i" 
 cat $i 
done 

Jean-Marc

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu