#!/bin/bash

[ -f /etc/init.d/functions ] && . /etc/init.d/functions

function usage(){
	echo "USAGE:$0 url"
	exit 1
}

RETVAL=0
function CheckUrl(){
	wget -T 10 --spider -t 2 $1 &>/dev/null
	RETVAL=$?
	if [ $RETVAL -eq 0 ];then
		action "$1 url" /bin/true
	else
		action "$1 url" /bin/false
	fi
	return $RETVAL
}

function main(){
	if [ $# -ne 1 ];then
		usage
	fi
	CheckUrl $1
}

main $*

相关文章:

  • 2022-02-19
  • 2022-12-23
  • 2021-09-26
  • 2021-12-17
  • 2022-01-13
  • 2021-11-12
猜你喜欢
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2021-04-28
相关资源
相似解决方案