1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
#!/bin/sh
#remove any previous directory
if [ -d ./$1_pack ]
then
rm -r $1_pack
fi
case "$1" in
"")
echo "Usage: ./package <new package name>"
exit 1
;;
esac
mkdir $1_pack
if [ -d ./data ]
then
mkdir $1_pack/data
cp ./data/*.dat $1_pack/data
else
echo "Could not find ./data directory. Failed."
exit 1
fi
if [ -d ./areas ]
then
mkdir $1_pack/areas
cp ./areas/*.area $1_pack/areas
else
echo "Could not find ./areas directory. Failed."
exit 1
fi
if [ -d ./data/help ]
then
mkdir $1_pack/data/help
cp ./data/help/*.help $1_pack/data/help
else
echo "Could not find ./data/help directory, Failed."
exit 1
fi
if [ -d ./data/info ]
then
mkdir $1_pack/data/info
cp ./data/info/*.info $1_pack/data/info
else
echo "Could not find ./data/info directory, Failed."
exit 1
fi
if [ -d ./data/bulletins ]
then
mkdir $1_pack/data/bulletins
cp ./data/bulletins/*.btn $1_pack/data/bulletins
else
echo "Could not find ./data/bulletins directory, Failed."
exit 1
fi
if [ -d ./data/banner ]
then
mkdir $1_pack/data/banner
cp ./data/banner/*.banr $1_pack/data/banner
else
echo "Could not find ./data/banner directory, Failed."
exit 1
fi
if [ -d ./data/books ]
then
mkdir $1_pack/data/books
cp ./data/books/*.book $1_pack/data/books
else
echo "Could not find ./data/books directory, Failed."
exit 1
fi
tar -zcf $1_pack.tar.gz $1_pack
rm -r $1_pack
echo "AIME area package created with filename: $1_pack.tar.gz"
|