2007-12-10 18:38:42 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
TAR=@TAR@
|
|
|
|
ZCAT=@ZCAT@
|
|
|
|
WGET=@WGET@
|
|
|
|
CURL=@CURL@
|
|
|
|
|
|
|
|
DIR=`pwd`
|
|
|
|
|
2008-03-29 14:56:20 -04:00
|
|
|
if [ -x "$WGET" ] ; then
|
2007-12-10 18:38:42 -05:00
|
|
|
DOWNLOAD_CMD=$WGET
|
2010-06-08 15:35:07 -04:00
|
|
|
fi
|
|
|
|
if [ "x${DOWNLOAD_CMD}" = "x" -a -x "$CURL" ] ; then
|
|
|
|
DOWNLOAD_CMD="$CURL -O"
|
2007-12-10 18:38:42 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
base=http://files.freeswitch.org/
|
|
|
|
tarfile=$1
|
|
|
|
install=$2
|
|
|
|
|
2010-06-08 15:35:07 -04:00
|
|
|
echo -n "#"
|
|
|
|
pwd
|
|
|
|
echo "# $0 $1 $2"
|
|
|
|
|
2007-12-10 18:38:42 -05:00
|
|
|
if [ ! -f $tarfile ] ; then
|
|
|
|
$DOWNLOAD_CMD $base$tarfile
|
|
|
|
if [ ! -f $tarfile ] ; then
|
|
|
|
echo cannot find $tarfile
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -z $install ] ; then
|
|
|
|
test -d $install || mkdir $install
|
2008-01-07 03:32:43 -05:00
|
|
|
cd $install && $ZCAT -c -d $DIR/$tarfile | $TAR xf -
|
2007-12-10 18:38:42 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|