summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuff-di-wuff23
1 files changed, 23 insertions, 0 deletions
diff --git a/buff-di-wuff b/buff-di-wuff
index eea49d7..69b0d09 100755
--- a/buff-di-wuff
+++ b/buff-di-wuff
@@ -8,6 +8,29 @@ mkdir -p "${cache_dir}"
grep '^[^#]' '/etc/buff-di-wuff.list' | \
while read -r url; do
+ if echo "${url}" | \
+ grep -q '\*[^/]*$'; then
+ urlDir=$(
+ printf '%s\n' "${url}" | \
+ sed 's|/[^/]*$|/|'
+ )
+ urlFile=$(
+ printf '%s\n' "${url}" | \
+ sed '
+ s|^.*/||
+ s|\.|\.|g
+ s|*|.*|g
+ '
+ )
+ wget -O - "${urlDir}" 2> /dev/null | \
+ tr '"<>' '\n' | \
+ grep "^${urlFile}\$" | \
+ sort -u
+ else
+ printf '%s\n' "${url}"
+ fi
+ done | \
+ while read -r url; do
if ! wget -O "${cache_dir}/tmp" "${url}" 2> /dev/null; then
continue
fi