argument for port, env file, auto updater
This commit is contained in:
parent
b62ddcb741
commit
9c8cd2ee36
2 changed files with 12 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
.token
|
.token
|
||||||
|
.env
|
||||||
|
|
16
checker.sh
16
checker.sh
|
@ -1,14 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
version=`curl -s "https://ql.syncore.org/api/query?hosts=88.198.49.46%3A27015" | jq -r .servers[0].info.serverVersion`
|
if [ -f .env ]
|
||||||
|
then
|
||||||
|
export $(cat .env | xargs)
|
||||||
|
fi
|
||||||
|
|
||||||
|
version=`curl -s "https://ql.syncore.org/api/query?hosts=88.198.49.46%3A$1" | jq -r .servers[0].info.serverVersion`
|
||||||
|
|
||||||
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`
|
||||||
|
|
||||||
if $up_to_date
|
if $up_to_date
|
||||||
then
|
then
|
||||||
echo "Server is up to date, nothin todo."
|
echo "Server is up to date, nothin todo."
|
||||||
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}":
|
||||||
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 -H "Content-Type: application/json" -d "{\"username\": \"Server Updater\", \"content\": \"There has been an update, server version: $version, newest version: $new_version\"}" $discord_webhook
|
||||||
|
(cd ~/docker/tf2; docker compose exec tf2dm-1 ./rcon -H 88.198.49.46 -p $1 -P $rcon_password changelevel cp_process_final)
|
||||||
fi
|
fi
|
||||||
|
|
Reference in a new issue