Ignore:
Timestamp:
Jun 9, 2014, 2:00:26 PM (10 years ago)
Author:
alloc
Message:

Version 15: Fixes #16, adds --force to updatescripts

File:
1 edited

Legend:

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

    r46 r53  
    9494                echo 0
    9595        fi
     96}
     97
     98# Get the local engine version number (i.e. build id)
     99# Returns:
     100#   0 if no engine installed or no appmanifest found or buildid could not be read
     101#   Build Id otherwise
     102getLocalEngineVersion() {
     103        local APPMANIFEST=$(find $SDTD_BASE/engine -type f -name "appmanifest_251570.acf")
     104        local LOCAL=0
     105        if [ -f "$APPMANIFEST" ]; then
     106                LOCAL=$(grep buildid "$APPMANIFEST" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
     107                if [ $(isANumber "$LOCAL") -eq 0 ]; then
     108                        LOCAL=0
     109                fi
     110        fi
     111        echo $LOCAL
     112}
     113
     114# Get the latest remote engine version number (i.e. build id)
     115# Returns:
     116#   1 if build id could not be retrieved
     117#   Build Id otherwise
     118getRemoteEngineVersion() {
     119        cd $SDTD_BASE/steamcmd
     120        local REMOTE=$(./steamcmd.sh "+app_info_print 251570" +quit | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"public\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\  -f3)
     121        if [ $(isANumber "$REMOTE") -eq 0 ]; then
     122                REMOTE=1
     123        fi
     124        echo $REMOTE
    96125}
    97126
Note: See TracChangeset for help on using the changeset viewer.