まず、currentTimestampコマンドを手動で実行し、/home/steam/exiles/lastUpdateにリダイレクトする必要があります。

まず、currentTimestampコマンドを手動で実行し、/home/steam/exiles/lastUpdateにリダイレクトする必要があります。

どうすればいいですか?

まず、currentTimestampコマンドを手動で実行し、/home/steam/exiles/lastUpdateにリダイレクトする必要があります。

#!/bin/sh
# NOTE: app_info_print/update uses the cache rather than pulling new information. Probably unintended. Definitely not useful for this application.
# Hence we need to delete the appcache to force a refresh
# On our system, the appcache can be found in /home/steam/Steam/appcache

# Delete appcache
rm -rf /home/steam/Steam/appcache/

# Pull new info and compare new timestamp to saved timestamp
# You may need to initially run the command for currentTimestamp manually and redirect it to /home/steam/exiles/lastUpdate
currentTimestamp=$(/home/steam/steamcmd/steamcmd.sh +login anonymous +app_info_update 1 +app_info_print 443030 +quit | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"public\"$" | grep -m 1 -EB 10 "^\s+}" | grep -E "^\s+\"timeupdated\"\s+" | tr '[:blank:]"' ' ' | awk '{print $2}')
lastTimestamp=$(cat /home/steam/exiles/lastUpdate)

if [ $currentTimestamp -gt $lastTimestamp ];
then
        /home/steam/exiles/updateconan.sh
        echo "$currentTimestamp" > /home/steam/exiles/lastUpdate
fi

ご協力ありがとうございます

ベストアンサー1

私が知っている限り、1行に/home/steam/exiles/lastUpdate0()を含むファイルを生成するだけです。0

スクリプトが少し怠けます。ファイルが存在しないことを簡単に検出し、ファイルにゼロを挿入するだけです。

値が0の場合、ifステートメントがトリガーされ、正しいタイムスタンプ(つまりほぼ正しい)が挿入されます。

おすすめ記事