mirror of
https://salsa.debian.org/images-team/debian-cd.git
synced 2024-11-24 15:19:51 -01:00
Add initial grab_file helper for http download support
This commit is contained in:
parent
6ed69fe7e9
commit
c25418118a
32
tools/grab_file
Executable file
32
tools/grab_file
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# grab_file
|
||||
#
|
||||
# extra utility script - if a file does not exist in our mirror and
|
||||
# we've been told to use an http mirror, go grab it from there
|
||||
#
|
||||
# Takes 1 parameters: the the full path to the file (relative to the
|
||||
# base dir of the mirror)
|
||||
#
|
||||
# The MIRROR env var must be set
|
||||
# If we want to be able to download, HTTPMIRROR mus be set too
|
||||
|
||||
set -e
|
||||
#set -x
|
||||
|
||||
WANTED=$1
|
||||
|
||||
if [ "$MIRROR"x = ""x ] ; then
|
||||
echo $0: MIRROR not set
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -e "$MIRROR/$WANTED" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# else
|
||||
|
||||
DIR=$(dirname "$WANTED")
|
||||
mkdir -p "$MIRROR/$DIR"
|
||||
wget -o /tmp/log -q "$HTTPMIRROR/$WANTED" -O "$MIRROR/$WANTED"
|
Loading…
Reference in New Issue
Block a user