first commit
This commit is contained in:
commit
68bcfec868
3 changed files with 22 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.token
|
20
checker.sh
Executable file
20
checker.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/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
|
1
version.txt
Normal file
1
version.txt
Normal file
|
@ -0,0 +1 @@
|
|||
6896293
|
Reference in a new issue