Currently all this does is extract and recompress a map, all the other functions need to be stuck in the middle.
- Code: Select all
#!/bin/bash
# usage [scriptname] [file]
if test -f $1 # test that file exists
then echo $1 found # confirmation of file existence
else
echo no file to optimise, exiting nicely. # warn that file doesn't exist and exit
exit
fi
unzip -oq $1 -d repack_$1 # Extract the file
echo $1 extracted to repack_$1
# Compress
cd repack_$1/
7za a -tzip -mfb258 -mpass15 ../$1
# Clear up the junk
rm -rf *
cd ../
rmdir repack_$1/