Updated variable names to lower/camel case
This commit is contained in:
@@ -2,32 +2,32 @@
|
||||
set -euo pipefail
|
||||
|
||||
|
||||
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
|
||||
DATE="$(TZ=UTC date -R)"
|
||||
baseDir="$(realpath "$(dirname "${0}")")"
|
||||
date="$(TZ=UTC date -R)"
|
||||
|
||||
|
||||
source "${BASEDIR}/website.conf"
|
||||
source "${baseDir}/website.conf"
|
||||
|
||||
shopt -s extglob
|
||||
|
||||
|
||||
LINKS=($(find -P "${WEBROOT}/blog/" | grep 'index\.html' | grep -v 'blog/index\.html' | sed 's|index.html||g; s|.*/blog|blog|g' | sort))
|
||||
links=($(find -P "${webroot}/blog/" | awk '/index\.html/ && !/blog\/index\.html/ {sub(/index\.html/,"")sub(/.*\/blog/,"blog");print|"sort"}'))
|
||||
|
||||
|
||||
MENU="@(${LINKS[0]}"
|
||||
menu="@(${links[0]}"
|
||||
|
||||
for ((i=1;i<${#LINKS[@]};i++)); do
|
||||
MENU+="|${LINKS[${i}]}"
|
||||
for ((i=1;i<${#links[@]};i++)); do
|
||||
menu+="|${links[${i}]}"
|
||||
done
|
||||
|
||||
MENU+=")"
|
||||
menu+=")"
|
||||
|
||||
printf 'Select the link you wish to use\n'
|
||||
|
||||
select LINK in "${LINKS[@]}"
|
||||
select link in "${links[@]}"
|
||||
do
|
||||
case ${LINK} in
|
||||
${MENU})
|
||||
case ${link} in
|
||||
${menu})
|
||||
break
|
||||
;;
|
||||
*)
|
||||
@@ -39,37 +39,37 @@ done
|
||||
|
||||
shopt -u extglob
|
||||
|
||||
TITLE="$(cat "${WEBROOT}/${LINK}/index.html" | grep -A1 '<title>' | grep '\[' | sed 's|.*\[ ||g; s| \| easthighNerd \].*||')"
|
||||
title="$(cat "${webroot}/${link}/index.html" | awk '/<title>/{getline;print}' | sed 's|.*\[ ||g; s| \| easthighNerd \].*||')"
|
||||
|
||||
printf 'Description of blog post:\n'
|
||||
read -r DESCRIPTION
|
||||
read -r description
|
||||
|
||||
|
||||
cat "${WEBROOT}/blog/feed.rss" | sed '/<last.*$/Q' | tee "${WEBROOT}/blog/feed.rss.tmp" &> /dev/null
|
||||
cat "${webroot}/blog/feed.rss" | sed '/<last.*$/Q' | tee "${webroot}/blog/feed.rss.tmp" &> /dev/null
|
||||
|
||||
cat << EOF | tee --append "${WEBROOT}/blog/feed.rss.tmp" &> /dev/null
|
||||
cat << EOF | tee --append "${webroot}/blog/feed.rss.tmp" &> /dev/null
|
||||
<lastBuildDate>
|
||||
${DATE}
|
||||
${date}
|
||||
</lastBuildDate>
|
||||
<item>
|
||||
<title>
|
||||
${TITLE}
|
||||
${title}
|
||||
</title>
|
||||
<link>
|
||||
${WEBSITE_URL}/${LINK}
|
||||
${websiteUrl}/${link}
|
||||
</link>
|
||||
<guid>
|
||||
$(uuidgen)
|
||||
</guid>
|
||||
<pubDate>
|
||||
${DATE}
|
||||
${date}
|
||||
</pubDate>
|
||||
<description>
|
||||
${DESCRIPTION}
|
||||
${description}
|
||||
</description>
|
||||
</item>
|
||||
EOF
|
||||
|
||||
cat "${WEBROOT}/blog/feed.rss" | sed '1,29d' | tee --append "${WEBROOT}/blog/feed.rss.tmp" &> /dev/null
|
||||
cat "${webroot}/blog/feed.rss" | sed '1,29d' | tee --append "${webroot}/blog/feed.rss.tmp" &> /dev/null
|
||||
|
||||
mv "${WEBROOT}/blog/feed.rss.tmp" "${WEBROOT}/blog/feed.rss"
|
||||
mv "${webroot}/blog/feed.rss.tmp" "${webroot}/blog/feed.rss"
|
||||
|
||||
Reference in New Issue
Block a user