#!/bin/sh #monitor URL #by zkg 2019-08-13
#打印提示信息函数 Usage(){ echo "Usage:sh $0 URL" exit 1 }
#检查URL函数 CheckUrl(){ wget -T 10 --spider -t 2 $1 &>/dev/null if [ $? -eq 0 ];then echo "$1 is Normal links" exit 0 else echo "$1 is not Normal links" exit 2 fi } #主函数 main(){ if [ $# -ne 1 ];then Usage fi CheckUrl $1 } main $*