[LEDE-DEV] [PATCH] base-files: sysupgrade. Added the ability to use URL as source

Bastian Bittorf bb at npl.de
Tue Jul 5 02:03:21 PDT 2016


* adron at yapic.net <adron at yapic.net> [05.07.2016 10:55]:
> +wget_if_URL(){
> +	local url="$1"
> +	local url_repl_file="/tmp/sysupgrade-URL.bin"
> +
> +	case "$url" in
> +		http://*|https://*|ftp://*) break ;;
> +		*) return 1 ;;

please use 'return 0' here, otherwise...

> +	esac
> +
> +	wget "$url" -O "$url_repl_file" || {
> +		echo "Wget return error $? for url '$url'"
> +		echo "Exiting"
> +		rm -f $url_repl_file
> +
> +		return 1
> +	}
> +
> +	ARGV=${ARGV/"$url"/"$url_repl_file"}
> +	return 0
> +}
> +
> +# if URL was specified then download image file throw wget
> +wget_if_URL "$ARGV" || exit 1

...we always break here if ARGV has no url


thanks & bye...please send the next patch with a e.g. 'v3' and short
describe changes - so the commiters are aware which one is the right
one.

bye, bastian



More information about the Lede-dev mailing list