1
0
mirror of https://github.com/openresty/openresty synced 2025-02-23 08:19:34 +01:00
openresty/util/get-tarball
2011-02-16 16:25:19 +08:00

22 lines
365 B
Bash
Executable File

#!/bin/bash
root=$(readlink -f -- "$(dirname -- "$0")/..")
work=$root/work
if [ ! -d $work ]; then
mkdir $work || exit 1
fi
url=$1
outfile=$3
cachefile=$work/$outfile
if [ -s $cachefile ]; then
cp $work/$outfile $outfile || exit 1
else
wget --no-check-certificate $1 -O $3 || exit 1
if [ $? == 0 ]; then
cp $3 $work/ || exit 1
fi
fi