2020-04-24 23:36:52 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
source lib-cache.sh
|
|
|
|
|
|
|
|
get_file() {
|
2021-12-06 16:07:01 +00:00
|
|
|
url="$1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
if [ -n "$url" ]; then
|
|
|
|
curl "$1";
|
|
|
|
else
|
|
|
|
echo -n;
|
|
|
|
fi;
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
url="$1";
|
|
|
|
name="$2";
|
|
|
|
name=${name:-$(basename "$url")}
|
|
|
|
|
|
|
|
cached_output get_file "${name%%.*}" "$url" "${name#*.}"
|