From 53d60086d2c3c05c57a5ec0e156ce84976ae8b03 Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Thu, 29 May 2025 15:25:01 -0600 Subject: variable inputs --- sitemap.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'sitemap.sh') diff --git a/sitemap.sh b/sitemap.sh index ab73965..5d0a42e 100755 --- a/sitemap.sh +++ b/sitemap.sh @@ -1,17 +1,17 @@ #!/bin/bash -# url configuration -URL="https://$(hostname)/" +HOSTNAME=${HOSTNAME:-$(hostname)} +URL="https://$HOSTNAME/" # values: always hourly daily weekly monthly yearly never -FREQ="weekly" +FREQ=${FREQ:-"weekly"} -# begin new sitemap +generate(){ exec 1> sitemap.xml # print head echo '' -echo '' +echo '' echo '' # print urls @@ -21,11 +21,14 @@ while read -r line; do DATE=${line:0:10} FILE=${line:12} echo "" - echo " ${URL}${FILE}" - echo " $DATE" - echo " $FREQ" + echo "${URL}${FILE}" + echo "$DATE" + echo "$FREQ" echo "" done # print foot echo "" +} + +generate -- cgit v1.2.3