Ignore:
Timestamp:
Nov 13, 2023, 4:38:42 PM (12 months ago)
Author:
alloc
Message:

Scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/usr/local/lib/7dtd/common.sh

    r478 r479  
    185185        if [ "$DOCHECK" = "yes" ]; then
    186186                echo "Updating version information..."
    187                 rm /root/Steam/appcache/appinfo.vdf
     187                rm -f /root/Steam/appcache/appinfo.vdf
    188188                cd $SDTD_BASE/steamcmd
    189189               
    190190                expect /usr/local/lib/7dtd/steamcmd.exp $SDTD_BASE/steamcmd/steamcmd.sh 294420 2>/dev/null > /tmp/7dtd-appinfo
    191191
    192                 local BUILDID=$(getBuildId public)
     192                local BUILDID=$(getRemoteBuildId public)
    193193
    194194                if [ $(isANumber "$BUILDID") -eq 0 ]; then
     
    205205#   BuildId otherwise
    206206getRemoteBuildId() {
     207        if [ ! -f "/tmp/7dtd-appinfo" ]; then
     208                echo "?"
     209                return
     210        fi
     211       
    207212        local BUILDID=$(grep -A 1000 \"branches\" /tmp/7dtd-appinfo | grep -A 1000 \"$1\" | grep -B 10 \} --max-count=1 | grep \"buildid\" | cut -d\" -f4)
    208213
     
    221226#   Update timestamp otherwise
    222227getRemoteBuildUpdateTime() {
     228        if [ ! -f "/tmp/7dtd-appinfo" ]; then
     229                echo "?"
     230                return
     231        fi
     232       
    223233        local TIMESTAMP=$(grep -A 1000 \"branches\" /tmp/7dtd-appinfo | grep -A 1000 \"$1\" | grep -B 10 \} --max-count=1 | grep \"timeupdated\" | cut -d\" -f4)
    224234       
     
    234244#   Blank separated list of branch names (can be empty if an error occured)
    235245getBranchNames() {
     246        if [ ! -f "/tmp/7dtd-appinfo" ]; then
     247                return
     248        fi
     249       
    236250        grep -A 1000 \"branches\" /tmp/7dtd-appinfo | grep -E '^[[:space:]]*"[^"]+"[[:space:]]*$' | tail --lines=+2 | cut -d\" -f2
    237251}
Note: See TracChangeset for help on using the changeset viewer.