forked from Mirrors/freeswitch
5cd4a3d0cb
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7982 d0543943-73ff-0310-b7d9-9358b9ac24b2
37 lines
530 B
Bash
Executable File
37 lines
530 B
Bash
Executable File
#!/bin/sh
|
|
|
|
TAR=@TAR@
|
|
ZCAT=@ZCAT@
|
|
WGET=@WGET@
|
|
CURL=@CURL@
|
|
|
|
DIR=`pwd`
|
|
|
|
if [ -x "$WGET" ] ; then
|
|
DOWNLOAD_CMD=$WGET
|
|
else
|
|
if [ -x "$CURL" ] ; then
|
|
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
|
|
cd $install && $ZCAT -c -d $DIR/$tarfile | $TAR xf -
|
|
fi
|
|
|
|
exit 0
|
|
|