2007-12-10 18:38:42 -05:00
|
|
|
#!/bin/sh
|
2012-04-25 04:04:00 -04:00
|
|
|
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
|
2007-12-10 18:38:42 -05:00
|
|
|
|
|
|
|
TAR=@TAR@
|
|
|
|
ZCAT=@ZCAT@
|
|
|
|
WGET=@WGET@
|
|
|
|
CURL=@CURL@
|
|
|
|
|
|
|
|
DIR=`pwd`
|
|
|
|
|
2012-04-25 04:05:42 -04:00
|
|
|
if [ -x "$WGET" ]; then
|
2012-04-25 04:04:00 -04:00
|
|
|
DOWNLOAD_CMD=$WGET
|
2010-06-08 15:35:07 -04:00
|
|
|
fi
|
|
|
|
if [ "x${DOWNLOAD_CMD}" = "x" -a -x "$CURL" ] ; then
|
2015-05-26 10:13:13 -04:00
|
|
|
DOWNLOAD_CMD="$CURL -L -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:05:42 -04:00
|
|
|
if [ -n "$FS_SOUNDS_DIR" ]; then
|
2012-04-25 04:04:00 -04:00
|
|
|
[ -d $FS_SOUNDS_DIR ] || mkdir -p $FS_SOUNDS_DIR
|
|
|
|
DIR=$FS_SOUNDS_DIR
|
2012-04-25 04:03:10 -04:00
|
|
|
fi
|
|
|
|
|
2012-04-25 04:05:42 -04:00
|
|
|
if [ ! -f $DIR/$tarfile ]; then
|
2012-04-25 04:03:10 -04:00
|
|
|
(cd $DIR && $DOWNLOAD_CMD $base$tarfile)
|
2012-04-25 04:05:42 -04:00
|
|
|
if [ ! -f $DIR/$tarfile ]; then
|
|
|
|
echo "cannot find $tarfile"
|
2012-04-25 04:03:10 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
2007-12-10 18:38:42 -05:00
|
|
|
fi
|
|
|
|
|
2012-04-25 04:05:42 -04:00
|
|
|
if [ ! -z "$install" ]; then
|
2012-04-25 04:04:00 -04:00
|
|
|
test -d $install || mkdir $install
|
2012-04-25 04:05:42 -04:00
|
|
|
(cd $install && $ZCAT -c -d $DIR/$tarfile | $TAR xf -)
|
2007-12-10 18:38:42 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|