blob: 2b8aff4396ac72a53707c910a0b9d62719fcf24d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
get_file_http() {
wget --tries=10 --no-verbose --user-agent="bwLehrpool-Download" -O "${FILE}" "${HTTP_BASE}/${FILE}"
ERR=$?
}
get_files_http() {
local FILE
echo "# Downloading static files."
cd "$BASEDIR/static_files"
for FILE in $HTTP_FILES; do
echo -n "# Downloading: "
get_file_http
if [ "$ERR" -ne 0 ]; then
echo
echo "# Could not download file ${HTTP_BASE}/${FILE}. Please check the variables"
echo "# HTTP_BASE and HTTP_FILES given in includes 00-variables.inc."
echo "# Values now: HTTP_BASE: $HTTP_BASE - HTTP_FILES: $HTTP_FILE."
echo "#"
echo "# This is a serious error, as there is no point in commencing script"
echo "# execution when static files are missing."
echo "#"
echo "# Terminating."
break
fi
done
[[ "$ERR" -eq 0 ]] && echo "# Static files were downloaded correctly."
cd - 1>/dev/null
}
|