added check with server queries, added discord webhook
This commit is contained in:
parent
68bcfec868
commit
1687acd00f
1 changed files with 2 additions and 8 deletions
10
checker.sh
10
checker.sh
|
@ -1,11 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
token=$(<.token)
|
version=`curl -s "https://ql.syncore.org/api/query?hosts=88.198.49.46%3A27015" | jq -r .servers[0].info.serverVersion`
|
||||||
|
|
||||||
git_username="spenny.tf"
|
|
||||||
git_repo="tf2-servers"
|
|
||||||
|
|
||||||
version=$(<version.txt)
|
|
||||||
|
|
||||||
up_to_date=`curl -s "https://api.steampowered.com/ISteamApps/UpToDateCheck/v1/?appid=440&version=${version}" | jq -r .response.up_to_date`
|
up_to_date=`curl -s "https://api.steampowered.com/ISteamApps/UpToDateCheck/v1/?appid=440&version=${version}" | jq -r .response.up_to_date`
|
||||||
|
|
||||||
|
@ -15,6 +10,5 @@ then
|
||||||
else
|
else
|
||||||
new_version=`curl -s "https://api.steampowered.com/ISteamApps/UpToDateCheck/v1/?appid=440&version=${version}" | jq -r .response.required_version`
|
new_version=`curl -s "https://api.steampowered.com/ISteamApps/UpToDateCheck/v1/?appid=440&version=${version}" | jq -r .response.required_version`
|
||||||
echo "There has been an update, server version: ${version}, newest version: ${new_version}"
|
echo "There has been an update, server version: ${version}, newest version: ${new_version}"
|
||||||
echo $new_version > version.txt
|
curl -H "Content-Type: application/json" -d '{"username": "Server Version", "content": "There has been an update, server version: ${version}, newest version: ${new_version}"}' "https://discord.com/api/webhooks/1027862143871221770/iK9CAShzV5nrVW_k7m9fouHa5EIOPoXCOofCp7ap9JYEKgmlYgaIgf3NJ2YFb_wy-Y7s"
|
||||||
curl -X POST https://drone.boehm.sh/api/repos/$git_username/$git_repo/builds -H "Authorization: Bearer $token"
|
|
||||||
fi
|
fi
|
||||||
|
|
Reference in a new issue