mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 22:26:42 +00:00
scripts/get: add mirror support
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
75e8a3b157
commit
4eae00b707
15
scripts/get
15
scripts/get
@ -35,7 +35,15 @@ if [ -n "$PKG_URL" ]; then
|
||||
URLS="$URLS `echo $PKG_URL | sed s%GEEXBOX_SRCS%$GEEXBOX_SRCS%`"
|
||||
|
||||
for i in $URLS; do
|
||||
PACKAGE="$SOURCES/$1/`basename $i`"
|
||||
OPENELEC_MIRROR="http://sources.openelec.tv/mirror"
|
||||
SOURCE_NAME="`basename $i`"
|
||||
PACKAGE="$SOURCES/$1/$SOURCE_NAME"
|
||||
PACKAGE_MIRROR="$OPENELEC_MIRROR/$PKG_NAME/$SOURCE_NAME"
|
||||
[ "$VERBOSE" != "yes" ] && WGET_OPT=-q
|
||||
WGET_CMD="wget --passive-ftp --no-check-certificate -c $WGET_OPT -P $SOURCES/$1"
|
||||
|
||||
NBWGET="1"
|
||||
|
||||
STAMP="$PACKAGE.url"
|
||||
MD5SUM="$PACKAGE.md5"
|
||||
|
||||
@ -53,10 +61,7 @@ if [ -n "$PKG_URL" ]; then
|
||||
printf "%${INDENT}c GET $1\n" >&$SILENT_OUT
|
||||
export INDENT=$((${INDENT:-1}+$INDENT_SIZE))
|
||||
|
||||
[ "$VERBOSE" != "yes" ] && WGET_OPT=-q
|
||||
|
||||
NBWGET="1"
|
||||
until [ -f "$STAMP" ] || wget --passive-ftp --no-check-certificate -c $WGET_OPT -P $SOURCES/$1 $i; do
|
||||
until [ -f "$STAMP" ] || $WGET_CMD $i || $WGET_CMD $PACKAGE_MIRROR; do
|
||||
NBWGET=$(($NBWGET+1))
|
||||
if [ "$NBWGET" -gt "10" ]; then
|
||||
echo -e "\nCant't get $1 sources : $i\n Try later !!"
|
||||
|
Loading…
x
Reference in New Issue
Block a user