remove old code
This commit is contained in:
parent
b6d35ef9e3
commit
69245353c0
1 changed files with 24 additions and 31 deletions
|
|
@ -4,41 +4,34 @@ rconpass=my_rcon_password
|
||||||
modio_api_key=my_modio_apikey_!NOT_OAuth2_KEY!
|
modio_api_key=my_modio_apikey_!NOT_OAuth2_KEY!
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
# TOTAL=0
|
|
||||||
sleep $(((RANDOM % 360) + 60))
|
sleep $(((RANDOM % 360) + 60))
|
||||||
# for rconip in $(echo "${rconlist//,/ }"); do
|
#CHECKING NEW GAME VERSION
|
||||||
# PLAYERSCOUNT=$(rcon -a "$rconip" -p "$rconpass" listplayers | tail -n +3 | wc -l)
|
LOCALAPPVER=$(cat /opt/sandstorm-server.version)
|
||||||
# TOTAL=$(("$PLAYERSCOUNT" + "$TOTAL"))
|
REMOTEAPPVER=$(curl -s -X GET 'https://api.steamcmd.net/v1/info/581330' | jq -r -e '.data."581330".depots."581333".manifests.public')
|
||||||
# done
|
EXITSTATUS=$?
|
||||||
# if [ $TOTAL -eq 0 ]; then
|
if [ $EXITSTATUS -eq 0 ]; then
|
||||||
#CHECKING NEW GAME VERSION
|
#CHECKING ISMC NEW VERSION
|
||||||
LOCALAPPVER=$(cat /opt/sandstorm-server.version)
|
LOCALMODVER=$(cat /opt/sandstorm-mod.version)
|
||||||
REMOTEAPPVER=$(curl -s -X GET 'https://api.steamcmd.net/v1/info/581330' | jq -r -e '.data."581330".depots."581333".manifests.public')
|
REMOTEMODVER=$(curl -s -X GET "https://api.mod.io/v1/games/254/mods/150867?api_key=$modio_api_key" -H 'Accept: application/json' | jq -r -e .modfile.filehash.md5)
|
||||||
EXITSTATUS=$?
|
EXITSTATUS=$?
|
||||||
if [ $EXITSTATUS -eq 0 ]; then
|
if [ $EXITSTATUS -eq 0 ]; then
|
||||||
#CHECKING ISMC NEW VERSION
|
if [[ ("$LOCALAPPVER" != "$REMOTEAPPVER" || "$LOCALMODVER" != "$REMOTEMODVER") ]]; then
|
||||||
LOCALMODVER=$(cat /opt/sandstorm-mod.version)
|
echo "$REMOTEAPPVER" >/opt/sandstorm-server.version
|
||||||
REMOTEMODVER=$(curl -s -X GET "https://api.mod.io/v1/games/254/mods/150867?api_key=$modio_api_key" -H 'Accept: application/json' | jq -r -e .modfile.filehash.md5)
|
echo "$REMOTEMODVER" >/opt/sandstorm-mod.version
|
||||||
EXITSTATUS=$?
|
for n in {1800..1}; do
|
||||||
if [ $EXITSTATUS -eq 0 ]; then
|
for rconip in $(echo "${rconlist//,/ }"); do
|
||||||
if [[ ("$LOCALAPPVER" != "$REMOTEAPPVER" || "$LOCALMODVER" != "$REMOTEMODVER") ]]; then
|
if ((n / 60 == 0)); then
|
||||||
echo "$REMOTEAPPVER" >/opt/sandstorm-server.version
|
rcon -a "$rconip" -p "$rconpass" "say 'THE SERVER WILL BE RESTARTED IN $n seconds'"
|
||||||
echo "$REMOTEMODVER" >/opt/sandstorm-mod.version
|
elif ((n % 60 == 0)); then
|
||||||
for n in {1800..1}; do
|
rcon -a "$rconip" -p "$rconpass" "say 'THE SERVER WILL BE RESTARTED IN $((n / 60)) minutes'"
|
||||||
for rconip in $(echo "${rconlist//,/ }"); do
|
fi
|
||||||
if ((n / 60 == 0)); then
|
sleep 1
|
||||||
rcon -a "$rconip" -p "$rconpass" "say 'THE SERVER WILL BE RESTARTED IN $n seconds'"
|
|
||||||
elif ((n % 60 == 0)); then
|
|
||||||
rcon -a "$rconip" -p "$rconpass" "say 'THE SERVER WILL BE RESTARTED IN $((n / 60)) minutes'"
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
done
|
done
|
||||||
#START OF BLOCK WHERE YOU CAN WRITE RESTART COMMANDS
|
done
|
||||||
/opt/restart-ins.sh
|
#START OF BLOCK WHERE YOU CAN WRITE RESTART COMMANDS
|
||||||
#END BLOCK WHERE YOU CAN WRITE RESTART COMMANDS
|
/opt/restart-ins.sh
|
||||||
fi
|
#END BLOCK WHERE YOU CAN WRITE RESTART COMMANDS
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue