#!/bin/bash
#################################################################
# Silicon Software mE5 VQ8 CXP6D Applets Linux Installer Script
#################################################################
die() {
echo "Error!"; exit 1;
}
print_usage() {
cat << EOF
Usage: $0 options
OPTIONS:
-d
installation target directory (default: /opt/SiliconSoftware/Runtime5.7.0/dll/mE5VQ8-CXP6D)
-y assume YES on questions (default: no)
-h print this help
EOF
}
if [ "$USER" != "root" ]; then
echo "Installer needs to be run as 'root'!"
exit 1
fi
cat << EOF
#################################################################
# Silicon Software mE5 VQ8 CXP6D Applets Linux Installer
#################################################################
EOF
INSTALLATION_DIRECTORY=/opt/SiliconSoftware/Runtime5.7.0/dll/mE5VQ8-CXP6D
ASSUME_YES=no
while getopts "d:e:s:y:h" OPTION
do
case $OPTION in
d)
INSTALLATION_DIRECTORY=$OPTARG
;;
y)
ASSUME_YES=$OPTARG
;;
h)
print_usage
exit
;;
?)
print_usage
exit
;;
esac
done
cat << EOF
INSTALLATION PARAMETERS:
Target directory : $INSTALLATION_DIRECTORY
EOF
echo -n "Are you sure to proceed (yes/no)? "
if [ "$ASSUME_YES" == "yes" ]; then
echo "yes"
else
read
if [ "$REPLY" != "yes" ]; then
exit
fi
fi
cat << EOF
#################################################################
# Now Installing ....
#################################################################
EOF
BASEPATH="$(cd "$(dirname "$0")"; pwd)"
INSTALLARCHIVE=setup-mE5-VQ8-CXP6D-ACQ-Applets-5.7.0-linux-ia32.tar.bz2
echo -n "Creating target directory ... "
mkdir -p $INSTALLATION_DIRECTORY || die
cd $INSTALLATION_DIRECTORY || die
INSTALLATION_DIRECTORY_ABS=$(pwd)
echo "Done"
(
echo -n "Checking installation archive \"$INSTALLARCHIVE\" ... "
if [ -e "$BASEPATH/$INSTALLARCHIVE" ]; then
echo "Done"
else
echo "Missing"
exit 1
fi
echo -n "Unpacking Silicon Software mE5 VQ8 CXP6D Applets to directory \"$INSTALLATION_DIRECTORY_ABS\" ... "
tar -xvf "$BASEPATH/$INSTALLARCHIVE" > /dev/null || die
echo "Done"
) | tee $INSTALLATION_DIRECTORY_ABS/install_log.txt 2>&1
exit 0