Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

GPGnet Vault Map Mirror Process

By: cursix on Apr 18th, 2012  |  syntax: Bash  |  size: 1.02 KB  |  hits: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. MAPDIR="/path/to/maps"
  4. MIRRORDIR="/path/to/mirror"
  5. MIRROREXTRACT="/path/to/extract"
  6. ERRORLIST="/path/to/errorlist"
  7.  
  8. test -e $MIRRORDIR || mkdir -p $MIRRORDIR
  9. test -e $MIRROREXTRACT || mkdir -p $MIRROREXTRACT
  10.  
  11. cd $MAPDIR
  12.  
  13. for map in *; do
  14.         mapver=0
  15.         for (( i=1; i<20; i++ )); do
  16.                 if [ -f "$map/$i.vault" ]; then
  17.                         mapver=$i
  18.                 fi
  19.         done
  20.  
  21.         if [ $mapver -lt 1 ]; then
  22.                 # Let's note what maps were not found
  23.                 echo $map >> $ERRORLIST
  24.                 continue
  25.         fi
  26.  
  27.         echo "----------------------------------"
  28.         echo "Processing $map..."
  29.         mkdir -p "$MIRROREXTRACT/$map"
  30.         7za x "$map/$mapver.vault" -o"$MIRROREXTRACT/$map"
  31. done
  32.  
  33. echo "Extraction Complete, moving to Zip Creation..."
  34.  
  35. cd $MIRROREXTRACT
  36.  
  37. for map in *; do
  38.         echo "----------------------------------"
  39.         echo "Zipping $map"
  40.         7za a -tzip "$MIRRORDIR/$map.zip" "$map" -mx=9
  41. done