Changeset 308 for scripts/usr/local/lib/7dtd/common.sh
- Timestamp:
- Aug 7, 2017, 7:18:35 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/lib/7dtd/common.sh
r304 r308 111 111 } 112 112 113 # Get the installed branch name 114 # Returns: 115 # "public" if no engine installed or no appmanifest found or buildid could not be read 116 # Branch name 117 getLocalBranch() { 118 local APPMANIFEST=$(find $SDTD_BASE/engine -type f -name "appmanifest_294420.acf") 119 local LOCAL="public" 120 if [ -f "$APPMANIFEST" ]; then 121 LOCAL=$(grep betakey "$APPMANIFEST" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) 122 if [[ -z $LOCAL ]]; then 123 LOCAL="public" 124 else 125 echo $LOCAL 126 return 127 fi 128 fi 129 echo $LOCAL 130 } 131 113 132 # Get the local engine version number (i.e. build id) 114 133 # Returns: … … 127 146 } 128 147 129 # Get the latest remote engine version number (i.e. build id) 130 # Returns: 131 # 1 if build id could not be retrieved 132 # Build Id otherwise 133 getRemoteEngineVersion() { 134 cd $SDTD_BASE/steamcmd 135 local REMOTE=$(wget -qO- http://steamdb.info/api/GetRawDepots/?appid=294420 | sed 's/\\n/\n/g' | 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\ -f4) 136 137 if [ $(isANumber "$REMOTE") -eq 0 ]; then 138 REMOTE=1 139 fi 140 echo $REMOTE 148 # Get the local engine update time 149 # Returns: 150 # 0 if no engine installed or no appmanifest found or buildid could not be read 151 # Update time otherwise 152 getLocalEngineUpdateTime() { 153 local APPMANIFEST=$(find $SDTD_BASE/engine -type f -name "appmanifest_294420.acf") 154 local LOCAL=0 155 if [ -f "$APPMANIFEST" ]; then 156 LOCAL=$(grep LastUpdated "$APPMANIFEST" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) 157 if [ $(isANumber "$LOCAL") -eq 0 ]; then 158 LOCAL=0 159 else 160 date --date="@${LOCAL}" "+%Y-%m-%d %H:%M:%S" 161 return 162 fi 163 fi 164 echo $LOCAL 141 165 } 142 166 … … 234 258 # Names of hook files 235 259 getHooksFor() { 236 if [ -n $2]; then260 if [ -n "$2" ]; then 237 261 if [ -d $(getInstancePath $2)/hooks/$1 ]; then 238 262 local H
Note:
See TracChangeset
for help on using the changeset viewer.