This repository has been archived on 2024-10-26. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
tf2-trigger/checker.sh
2021-11-21 11:15:16 +01:00

20 lines
716 B
Bash
Executable file

#!/bin/bash
token=$(<.token)
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`
if $up_to_date
then
echo "Server is up to date, nothin todo."
else
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 $new_version > version.txt
curl -X POST https://drone.boehm.sh/api/repos/$git_username/$git_repo/builds -H "Authorization: Bearer $token"
fi