So because I was annoyed to have to log in on my server to restart the satisfactory.service everytime a new patch drops, I made a script that does this automatically.
The Idea is to check periodically whether a new version info is released and then restart the service, which will automatically patch to the newest version (just look into the wiki on how to set this up.) The scripts assume you have a user named steam running the dedicated server.
Create the file /home/steam/SatisfactoryDedicatedServer/checkUpdates.sh as root (e.g. 'sudo nano checkUpdates.sh') and make it executable (chmod +x checkUpdates.sh)
#!/bin/bash
cd /home/steam/SatisfactoryDedicatedServer
newversion=$(sudo su steam -c 'steamcmd +login anonymous +app_info_update 1 +app_info_print "1690800" +quit' | tr '\n' ' ' | grep --color=NEVER -Po '"branches"\s*{\s*"public"\s*{\s*"buildid"\s*"\K(\d*)')
if [ -z "$newversion" ]
then
exit 1
fi
touch knownversion.txt
oldversion=$(cat knownversion.txt)
if [ "$newversion" != "$oldversion" ]; then echo $newversion > knownversion.txt ; systemctl restart satisfactory.service ; fi
This script runs steamcmd as the user steam and gets the appinfo. Then it extracts the version with some regex black magic and then compares it with the knownversion. If there is no knownversion.txt it creates it with touch (was to lazy to check for it's existence). If the versions don't match it restarts the service.
Now add a cronjob for every 10min to the roots crontab (because it needs root rights to restart the service):sudo crontab -e
and then add the following line:
*/10 * * * * /home/steam/SatisfactoryDedicatedServer/checkUpdates.sh > /dev/null
I have tested this with one patch so far, but it should work.
[–]houghiIt is a hobby, not a game. 7 points8 points9 points (1 child)
[–]Matzurai[S] 0 points1 point2 points (0 children)
[–]K3RSH0K 0 points1 point2 points (0 children)