Skip to content

Instantly share code, notes, and snippets.

@mattiasghodsian
Last active April 28, 2023 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattiasghodsian/229582e8dec95ec40474e2c10266c860 to your computer and use it in GitHub Desktop.
Save mattiasghodsian/229582e8dec95ec40474e2c10266c860 to your computer and use it in GitHub Desktop.
Send GameID to Discord Channel for Core Keeper Dedicated Server
#!/bin/bash
# Author: Mattias Ghodsian
# Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5
# Donate coffee: https://www.buymeacoffee.com/mattiasghodsian
filename="path-to-game-file-directory/GameID.txt"
m1=$(md5sum "$filename")
while true; do
sleep 10
m2=$(md5sum "$filename")
if [ "$m1" != "$m2" ] ; then
gameid=`cat $filename`
echo $gameid
m1=$(md5sum "$filename")
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"${gameid}\"}" "discord-channel-wehbook-url-here"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment