一个简单的脚本

实现每天定时检查系统:

#!/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


你可能感兴趣的:(脚本,url,System)