summaryrefslogblamecommitdiffstats
path: root/satellit_installer/includes/20-get_files_http.inc
blob: 2b8aff4396ac72a53707c910a0b9d62719fcf24d (plain) (tree)




























                                                                                                            
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 
}