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
|
|
|
|
else
|
2008-03-29 14:56:20 -04:00
|
|
|
if [ -x "$CURL" ] ; then
|
2007-12-10 18:38:42 -05:00
|
|
|
DOWNLOAD_CMD="$CURL -O"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
base=http://files.freeswitch.org/
|
|
|
|
tarfile=$1
|
|
|
|
install=$2
|
|
|
|
|
|
|
|
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
|
|
|
|
|