add AutoUpdater scripts

This commit is contained in:
Andrew Marchukov 2021-04-24 11:09:22 +03:00
parent 292733fb11
commit 4399cd6d0e
3 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#!/bin/bash
while true ; do
sleep $(( ( RANDOM % 360 ) + 60 ))
LOCALAPPVER=$(cat /opt/sandstorm-server.version)
REMOTEAPPVER=$(curl -s -X GET 'https://api.steamcmd.net/v1/info/581330' | jq -r -e '.data."581330".depots."581333".manifests.public')
EXITSTATUS=$?
if [ $EXITSTATUS -eq 0 ]; then
if [ "$LOCALAPPVER" != "$REMOTEAPPVER" ]; then
/opt/restart-ins.sh
fi
fi
done

View file

@ -0,0 +1,14 @@
[Unit]
Description=check insurgency sandstorm server updates
Requires=network.target
[Service]
Type=simple
ExecStart=/opt/check-manifest.sh
ExecStop=/bin/kill -s TERM $MAINPID
KillMode=control-group
CPUSchedulingPolicy=idle
Nice=19
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,9 @@
#!/bin/bash
docker stop sandstorm-modmap
docker rm sandstorm-modmap
docker run -d --restart always --env-file /home/user/coop-modmap/modmap.env \
--name sandstorm-modmap -p 12345:12345/udp -p 54321:54321/udp \
-v /home/user/coop-modmap/Mods:/home/steam/steamcmd/sandstorm/Insurgency/Mods:rw \
-v /home/user/coop-modmap/config/ini:/home/steam/steamcmd/sandstorm/Insurgency/Saved/Config/LinuxServer:ro \
-v /home/user/coop-modmap/config/txt:/home/steam/steamcmd/sandstorm/Insurgency/Config/Server:ro andrewmhub/insurgency-sandstorm:latest
curl -X GET 'https://api.steamcmd.net/v1/info/581330' | jq -r '.data."581330".depots."581333".manifests.public' > /opt/sandstorm-server.version