Support URLs pointing to a zip file

This commit is contained in:
2026-03-13 06:12:44 +01:00
parent fbd1b543eb
commit 96729e414e
2 changed files with 13 additions and 3 deletions

View File

@@ -53,6 +53,8 @@ icscheck() {
for arg in "${@}" ; do
case "${1:-}" in
--debug|-d)
set -o xtrace && shift ;;
--help|-h)
icsusage && return 0 ;;
--renew|-r)
@@ -79,6 +81,11 @@ icscheck() {
curl -L "${ics_url}" -H "User-Agent: ${icsconf_useragent:?}" -o "${ics_down_file}" >/dev/null 2>&1
if [ -n "${icsconf_zip:-}" ]; then
unzip -oqq "${ics_down_file}" "${icsconf_zip}" -d "${ics_temp_dir}"
mv -f "${ics_temp_dir}/${icsconf_zip}" "${ics_down_file}"
fi
# -s : exists and size greater zero
if [ ! -s "$ics_down_file" ] || [ ! -r "$ics_down_file" ]; then
icsError
@@ -105,3 +112,4 @@ icscheck() {
}
icscheck "${@}"