ACE2のアップデートスクリプト
主な変更場所は、以下のとおり、RSYNCのタイムアウトが長かったので、15秒にしました。
ARMA_DIR:ARMA2本体があるパスを指定します。
ARMA_SYNC_DIR:ACE2のパッチを落とす作業ディレクトリ。ARMA2DIRとは別のディレクトリを指定します。
#!/bin/bash
#
# ACE Update script for linux
#
# by Dr.Pulp - www.FAKKer.de
#
#
#
# READ FIRST!!!
#
# In order to use this script you need to have gunzip and rsync installed!
#
# You will also need two seperate folders to use the advantage of rsync,
# because otherwise "tolower" will alter the filenames and rsync will download
# them again everytime you use the script.
#
# After the script finish succsessfully, you will have new folders depending of the number
# of mods you like to synchronize. the folders a called like the mod with a leading @.
#
##################################
# Configuration start #
##################################
# Directory where the arma server is installed
ARMA_DIR=/home/arma
# Direcotry where rsync stores the data. DON'T use a subdirectory of your arma directory!
ARMA_SYNC_DIR=/home/arma_data
# List of available Mirrors. You can add new mirrors, or delete ones that are no longer functioning. Leave a blank between mirrors!
MIRRORLIST=(dev-heaven.net s01.6thsense.eu s02.6thsense.eu 64.34.164.115 arma2.armagoons.com 213.245.0.237 six.bssnet.dk zeus2.zeus-community.net)
# Mods you like to synchronize with this script. For a complete list of available mods look at http://updater.dev-heaven.net/main !
# You can use every mod listet there -> just use the modname without @. Leave a blank between mods!
MODS="ace acex cba acex_pla fran_quesh_kibrul gl4 isla_duala japahto jtd namalsk panthera sap_everon six"
##################################
# Advanced Configuration #
##################################
# Define some of the OS tool the script uses. If you encounter an error you can check is your pathnames may differ with the type command. example: type rm
# this will tell you your exact path to your rm. in case it differs, edit this part...otherwise leave it as it is.
RM="/bin/rm -r"
RSYNC="/usr/bin/rsync --times --timeout=15 -O --no-whole-file -r --delete --progress -h --exclude=.rsync rsync://"
CP="/bin/cp -r"
GUNZIP="/bin/gunzip -r"
##################################
# Configuration end #
##################################
# Function: random mirror selection
RANDOM_MIRROR() {
MIRRORCOUNT=${#MIRRORLIST[*]}
MIRRORCOUNT=`expr $MIRRORCOUNT - 1`
MIRRORCOUNT=`expr 32767 / $MIRRORCOUNT`
MIRROR=${MIRRORLIST[$(($RANDOM/$MIRRORCOUNT))]}
}
# Loop: deleting folder, rsync, decompress ad copy for each mod you selected
for MOD in $MODS
do
$RM $ARMA_DIR/@$MOD
INFOSYNC='Starting to synchronize '$MOD'!'
echo ' ----------------'
echo $INFOSYNC
OK=1
BAILOUT=0
until [ "$OK" -lt "1" ]
do
RANDOM_MIRROR
$RSYNC$MIRROR/rel/$MOD/./.pack/ ${ARMA_SYNC_DIR}/@$MOD
OK=$?
BAILOUT=`expr $BAILOUT + 1`
if [ "$BAILOUT" -gt 10 ]
then
ENDE='There is a problem with rsync of mod '$MOD'! Aborting Script to prevent a loop! Check your directorys, user-rights or maybe just all mirrors are full at the moment'
echo $ENDE
exit
fi
done
INFOCOPY='Copying '$MOD' Mod to the destination folder!'
echo $INFOCOPY
$CP ${ARMA_SYNC_DIR}/@$MOD ${ARMA_DIR}
INFOZIP='Decompressing '$MOD' Mod!'
echo $INFOZIP
$GUNZIP ${ARMA_DIR}/@$MOD/*
done
# Converting filenames to lower case letters
${ARMA_DIR}/tolower
# copying keys, mpmissions and userconfig to the right folders
for MOD in $MODS
do
if test -e ${ARMA_DIR}/@$MOD/keys
then $CP ${ARMA_DIR}/@$MOD/keys/* ${ARMA_DIR}/keys
fi
if test -e ${ARMA_DIR}/@$MOD/mpmissions
then $CP ${ARMA_DIR}/@ace/mpmissions/* ${ARMA_DIR}/mpmissions
fi
if test -e ${ARMA_DIR}/@$MOD/userconfig
then
if test -e ${ARMA_DIR}/userconfig/$MOD
then
$CP ${ARMA_DIR}/@$MOD/userconfig/* ${ARMA_DIR}/userconfig/$MOD/
else
/bin/mkdir -p ${ARMA_DIR}/userconfig/$MOD
$CP ${ARMA_DIR}/@$MOD/userconfig/* ${ARMA_DIR}/userconfig/$MOD/
fi
fi
if test -e ${ARMA_DIR}/@$MOD/store/userconfig
then
if test -e ${ARMA_DIR}/userconfig/$MOD
then
$CP ${ARMA_DIR}/@$MOD/store/userconfig/* ${ARMA_DIR}/userconfig/$MOD/
else
/bin/mkdir -p ${ARMA_DIR}/userconfig/$MOD
$CP ${ARMA_DIR}/@$MOD/store/userconfig/* ${ARMA_DIR}/userconfig/$MOD/
fi
fi
done
exit
ブログ一覧 |
ARMA2 Server | パソコン/インターネット
Posted at
2010/07/04 15:32:09