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
|
#!/bin/sh
#remove any previous directory
case "$1" in
"")
echo "Usage: ./install_package <package name>"
echo "Do not include _pack.tar.gz in <package name>"
exit 1
;;
esac
if tar -zxf $1_pack.tar.gz; then
echo "Successfully decompressed."
else
echo "Decompress of package failed. Does $1_pack.tar.gz exist?"
exit 0;
fi
if [ -d ./data ]
then
cp ./$1_pack/data/*.dat data
else
echo "Could not find ./data directory to write to. Failed."
exit 1
fi
if [ -d ./areas ]
then
cp ./$1_pack/areas/*.area areas
else
echo "Could not find ./areas directory to write to. Failed."
exit 1
fi
if [ -d ./data/info ]
then
cp ./$1_pack/data/info/*.info data/info
else
echo "Could not find ./data/info directory to write to. Failed."
exit 1
fi
if [ -d ./data/help ]
then
cp ./$1_pack/data/help/*.help data/help
else
echo "Could not find ./data/help directory to write to. Failed."
exit 1
fi
if [ -d ./data/bulletins ]
then
cp ./$1_pack/data/bulletins/*.btn data/bulletins
else
echo "Could not find ./data/bulletins directory to write to. Failed."
exit 1
fi
if [ -d ./data/banner ]
then
cp ./$1_pack/data/banner/*.banr data/banner
else
echo "Could not find ./data/banner directory to write to. Failed."
exit 1
fi
if [ -d ./data/books ]
then
cp ./$1_pack/data/books/*.book data/books
else
echo "Could not find ./data/books directory to write to. Failed."
exit 1
fi
rm -r $1_pack
echo "Package files successfully integrated into AIME directories."
|