www.FAKKer.de • Thema anzeigen - Armed Assault 2: Linux Server Update Script
Aktuelle Zeit: Sa 4. Sep 2010, 08:13

Alle Zeiten sind UTC + 1 Stunde




Ein neues Thema erstellen Auf das Thema antworten  [ 4 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: Armed Assault 2: Linux Server Update Script
BeitragVerfasst: Mi 10. Feb 2010, 19:43 
Offline
Orga
Benutzeravatar

Registriert: So 11. Mai 2008, 16:15
Beiträge: 385
Wohnort: Hannover
Hi Folx,

here you can get the latest version of my ArmA2 Server Update Script (using the Six-Updater Framework).

Last Update: 10.02.2010
Code:
#!/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 -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


Greetings
Dr.Pulp


Nach oben
 Profil E-Mail senden  
 
 Betreff des Beitrags: Re: Armed Assault 2: Linux Server Update Script
BeitragVerfasst: Do 25. Feb 2010, 01:14 
Benutzeravatar
Hi!

I'm insterested on be able to update the A.C.E mod on our ArmA 2 server. Can i do it with your script? If so, could you explain how or link to some manual or FAQ?

Thanks in advance!,
John


Nach oben
  
 
 Betreff des Beitrags: Re: Armed Assault 2: Linux Server Update Script
BeitragVerfasst: Do 25. Feb 2010, 18:39 
Offline
Orga
Benutzeravatar

Registriert: So 11. Mai 2008, 16:15
Beiträge: 385
Wohnort: Hannover
yeah the script is exactly for that!

look at the beginning of the script...there i wrote how to use and configure it.
or do you need help on how to make the code work in the first place?


Nach oben
 Profil E-Mail senden  
 
 Betreff des Beitrags: Re: Armed Assault 2: Linux Server Update Script
BeitragVerfasst: Fr 26. Feb 2010, 22:27 
Benutzeravatar
ACE2 et.al. have changed "keys" to "store\keys". Other mods maybe havn't, so

Code:
:
:
if test -e ${ARMA_DIR}/@$MOD/store/keys
    then
      $CP ${ARMA_DIR}/@$MOD/store/keys/* ${ARMA_DIR}/keys
  else
      if test -e ${ARMA_DIR}/@$MOD/keys
      then
         $CP ${ARMA_DIR}/@$MOD/keys/* ${ARMA_DIR}/keys
      fi
  fi
:
:


is necessary.


Nach oben
  
 
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 4 Beiträge ] 

Alle Zeiten sind UTC + 1 Stunde


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Deutsche Übersetzung durch phpBB.de
Design by Dr.Pulp