#!/bin/bash function sendTelegram { local TEXT=$1 local SERVER="K0" #local MESSAGE=$2 #[[ ! -z "$MESSAGE" ]] && \ curl -s -X POST $URL -d chat_id=$CHAT_ID -d text="*${SERVER}*: $TEXT" -d parse_mode="markdown" >> /tmp/telegram.log } TOKEN= CHAT_ID= MESSAGE="Hello World" UR L="https://api.telegram.org/bot$TOKEN/sendMessage" #whois mate.cat | grep Date > ./mate.cat.tmp whois mate.cat > ./mate.cat.tmp [[ -f ./mate.cat.txt ]] && { DIFF=$(diff ./mate.cat.txt ./mate.cat.tmp) [[ $? != 0 ]] && { mv ./mate.cat.tmp ./mate.cat.txt sendTelegram "cambios en mate.cat: \`${DIFF}\`" } || { rm ./mate.cat.tmp } } || { whois mate.cat > ./mate.cat.txt }