blob: a8377121e8f96beb2e1e5a311493ce310006a40d [file] [log] [blame]
#!/bin/bash -xeu
#
# Copyright (C) 2012 The Chromium OS Authors.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
URL=http://www.dediprog.com/save/78.rar/to/EM100Pro_4.2.24.rar
FILE=$(basename $URL)
TEMP=$(mktemp -d)
WD=$(pwd)
function run_unrar()
{
if which rar >& /dev/null; then
rar x "$@"
return $?
elif which unrar >& /dev/null; then
unrar x "$@"
return $?
# unrar-free is not currently able to handle this file, but maybe
# a future update will fix it
#elif which unrar-free >& /dev/null; then
# unrar-free "$@"
# return $?
else
echo "No RAR unpacker found, aborting"
echo "Try installing rar or unrar."
return 1
fi
}
cd $TEMP
echo Downloading...
curl -s $URL -o $FILE || exit
echo Unpacking...
run_unrar $FILE ${FILE%.rar}.msi > /dev/null
7z x ${FILE%.rar}.msi PRO_* > /dev/null
echo Copying...
rm -rf $WD/configs
mkdir -p $WD/configs
for i in PRO_*; do
cp $i $WD/configs/${i#PRO_}.cfg
done
cd $WD
rm -rf $TEMP
echo Done...