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"
|
|
|
|
|
2012-04-25 04:03:10 -04:00
|
|
|
if [ -n "$FS_SOUNDS_DIR" ] ; then
|
|
|
|
[ -d $FS_SOUNDS_DIR ] || mkdir -p $FS_SOUNDS_DIR
|
|
|
|
DIR=$FS_SOUNDS_DIR
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f $DIR/$tarfile ] ; then
|
|
|
|
(cd $DIR && $DOWNLOAD_CMD $base$tarfile)
|
|
|
|
if [ ! -f $DIR/$tarfile ] ; then
|
|
|
|
echo cannot find $tarfile
|
|
|
|
exit 1
|
|
|
|
fi
|
2007-12-10 18:38:42 -05:00
|
|
|
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
|