代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
# DESCRIPTION
# Check all website given in the list file
#
# USAGE
# ./monitor-servers.sh me@host.com ./custom-list.txt
#
currentDir=$(cd "$(dirname "$0")"; pwd)
chmod +x ${currentDir}/*.sh
scriptDir="$(dirname "$0")" # emplacement du script
# . "$scriptDir"/toolboxrc # charge quelques function utiles (today, etc.). Le
. "$scriptDir"/stylerc # include some style
#clear
emailTo="${1:-me@host.com}"
srvList="${2:-"$scriptDir"/monitor-list-default.txt}" # URL to server
# @description check if requirement are met and display message
# @return void
function checkRequirement() {
if ! type mail 2> /dev/null; then
printf " \b--\n\t%s Requirement %s %s\t %s\n--\n\n" \
"$_w" \
"$(_warning "missing")" \
"$(_valid "->")" \
"$(_warning "Install and configure a 'mail' server")"
fi
}
# @description monitor the list of provider server, send mail to given adress
# @param $1|$srvList list of server to monitor
# @param $2|$emailTo target email adress
# @return void
function monitor()
{
local srvList="$1"
local emailTo="$2"
while read -r line
do
[[ "$line" = \#* ]] && continue # ignore lines starting by '#'
site="${line#*//}" # remove the protocole
site="${site%/*}" # remove trailing slash
#printf "Checking %s...\n\t" "$(_value ${site})"
"$scriptDir"/monitor-app.sh "$emailTo" "$line"
done < "$srvList"
}
# start
checkRequirement
monitor "$srvList" "$emailTo"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。