Changeset 53 for scripts/usr/local/lib/7dtd/commands/updateengine.sh
- Timestamp:
- Jun 9, 2014, 2:00:26 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/lib/7dtd/commands/updateengine.sh
r48 r53 4 4 5 5 sdtdCommandUpdateengine() { 6 for I in $(getInstanceList); do 7 if [ $(isRunning $I) -eq 1 ]; then 8 echo "At least one instance is still running (\"$I\")." 9 echo "Before updating the engine please stop all instances!" 10 return 11 fi 12 done 6 local FORCED=no 7 local CHECKONLY=no 8 if [ "$1" = "--force" ]; then 9 FORCED=yes 10 fi 13 11 14 12 if [ ! -e $SDTD_BASE/steamcmd ]; then … … 21 19 fi 22 20 23 cd $SDTD_BASE/steamcmd 21 if [ "$1" = "--check" -o "$2" = "--check" ]; then 22 local LOCAL=$(getLocalEngineVersion) 23 local REMOTE=$(getRemoteEngineVersion) 24 if [ $REMOTE -gt $LOCAL ]; then 25 echo "Newer engine version available." 26 else 27 echo "Engine up to date." 28 fi 29 echo "Local buildid: $LOCAL" 30 echo "Available buildid: $REMOTE" 31 return 32 fi 24 33 25 ./steamcmd.sh +@sSteamCmdForcePlatformType windows +login $STEAM_USER $STEAM_PASS +force_install_dir $SDTD_BASE/engine "+app_update 251570" validate +quit 34 for I in $(getInstanceList); do 35 if [ $(isRunning $I) -eq 1 ]; then 36 echo "At least one instance is still running (\"$I\")." 37 echo "Before updating the engine please stop all instances!" 38 return 39 fi 40 done 26 41 27 cp $SDTD_BASE/linux_files/engine/* $SDTD_BASE/engine/ -R28 cp $SDTD_BASE/engine/Install/32bit/SteamworksManaged.dll $SDTD_BASE/engine/7DaysToDie_Data/Managed/42 local LOCAL=$(getLocalEngineVersion) 43 local REMOTE=$(getRemoteEngineVersion) 29 44 30 chown $SDTD_USER.$SDTD_GROUP -R $SDTD_BASE/engine 45 if [ "$FORCED" = "yes" -o $REMOTE -gt $LOCAL ]; then 46 echo "A newer version of the engine is available." 47 echo "Local buildid: $LOCAL" 48 echo "Available buildid: $REMOTE" 49 echo 50 51 while : ; do 52 local CONTINUE 53 read -p "Continue? (yn) " CONTINUE 54 case $CONTINUE in 55 y) 56 echo "Updating..." 57 break 58 ;; 59 n) 60 echo "Canceled" 61 return 62 ;; 63 *) 64 echo "Wrong input" 65 esac 66 done 67 68 cd $SDTD_BASE/steamcmd 69 ./steamcmd.sh +@sSteamCmdForcePlatformType windows +login $STEAM_USER $STEAM_PASS +force_install_dir $SDTD_BASE/engine "+app_update 251570" validate +quit 70 71 cp $SDTD_BASE/linux_files/engine/* $SDTD_BASE/engine/ -R 72 cp $SDTD_BASE/engine/Install/32bit/SteamworksManaged.dll $SDTD_BASE/engine/7DaysToDie_Data/Managed/ 73 74 chown $SDTD_USER.$SDTD_GROUP -R $SDTD_BASE/engine 75 else 76 echo "Engine is already at the newest build (local: $LOCAL, remote: $REMOTE)." 77 fi 31 78 } 32 79 33 80 sdtdCommandUpdateengineHelp() { 34 echo "Usage: $(basename $0) updateengine "81 echo "Usage: $(basename $0) updateengine [--force | --check]" 35 82 echo 36 echo "Update the engine (aka game) files of 7dtd." 83 echo "Check for a newer version of engine (aka game) files of 7dtd. If there is a newer" 84 echo "version they can be updated by this command." 85 echo 86 echo "If --force is specified you are asked if you want to redownload the engine" 87 echo "even if there is no new version available." 88 echo 89 echo "If --check is specified it will only output the current local and remote build ids" 90 echo "and if an update is available." 37 91 } 38 92 … … 40 94 echo "Update the 7dtd engine files" 41 95 } 96 97 sdtdCommandUpdateengineExpects() { 98 case $1 in 99 2) 100 echo "--force --check" 101 ;; 102 esac 103 } 104
Note:
See TracChangeset
for help on using the changeset viewer.