X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=blobdiff_plain;f=dhtml.sh;fp=dhtml.sh;h=cefb84351192fd47c4d00dae80b44d6f01bc44e4;hp=8b74fe2eda2a12c2037a4111b971fbd07aafd4d0;hb=bef43acb5354ea8114c98a22aeabf9e7338ec90e;hpb=750f872cb118f152b3cf7c1756486667e472aa18 diff --git a/dhtml.sh b/dhtml.sh index 8b74fe2..cefb843 100755 --- a/dhtml.sh +++ b/dhtml.sh @@ -69,6 +69,14 @@ do line=$(sed -e "s/@SIZE{\([^}]*\)}/${filesize_h}/" <<<"${line}") done + while [[ ${line} =~ @URLDATE ]] + do + filename=$(sed -e "s/^.*@URLDATE{\([^}]*\)}.*$/\1/" <<<"${line}") + timestamp=$(curl -Lv "${filename}" 2>&1 | \grep '^< Last-Modified:' | sed -e 's/^.*Last-Modified: *//') + timestamp=$(date -d "${timestamp}" +'%b %e, %Y') + line=$(sed -e "s/@URLDATE{\([^}]*\)}/${timestamp}/" <<<"${line}") + done + while [[ ${line} =~ @FILEDATE ]] do filename=$(sed -e "s/^.*@FILEDATE{\([^}]*\)}.*$/\1/" <<<"${line}")