实现每天定时检查系统:
#!/bin/bash
#this scripts is for check all system by luckcart.
#for check mobi.luckcart.com
mobi_url="http://mobi.luckcart.com"
mobi_status=$(/usr/bin/curl -s --head "$mobi_url"|awk '/HTTP/ {print $2}')
echo "Now checking $mobi_url"
if [ "$mobi_status" == "200" ];
then
echo "$mobi_url is OK!"
else
echo "$mobi_url is not OK ,please check IT........"
fi