summaryrefslogtreecommitdiff
path: root/frontends/scripts
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-03-03 12:11:42 +0200
committerPaul Buetow <paul@buetow.org>2023-03-03 12:11:42 +0200
commit5a00f7db4b9fdf7582c7fb2c3cd16794ea5d93a6 (patch)
tree52d4454bc00b5b8931f7cb27f3a43723c40e472f /frontends/scripts
parentaaa1692ed7dcbd84f56149159838b0f846e3aa46 (diff)
fix
Diffstat (limited to 'frontends/scripts')
-rw-r--r--frontends/scripts/gemtexter.sh.tpl25
1 files changed, 25 insertions, 0 deletions
diff --git a/frontends/scripts/gemtexter.sh.tpl b/frontends/scripts/gemtexter.sh.tpl
index 47a6a0d..4fc76d9 100644
--- a/frontends/scripts/gemtexter.sh.tpl
+++ b/frontends/scripts/gemtexter.sh.tpl
@@ -15,6 +15,10 @@ function ensure_site {
fi
cd $parent
+ if [ ! -e www.$basename ]; then
+ ln -s $basename www.$basename
+ fi
+
if [ ! -d $basename ]; then
git clone $repo -b $branch --single-branch $basename
else
@@ -23,6 +27,23 @@ function ensure_site {
fi
}
+function ensure_links {
+ dir=$1
+ target=$2
+
+ basename=$(basename $dir)
+ parent=$(dirname $dir)
+
+ cd $parent
+ if [ ! -e $target ]; then
+ ln -s $basename $target
+ fi
+
+ if [ ! -e www.$target ]; then
+ ln -s $basename www.$target
+ fi
+}
+
<% if ($is_primary->($vio0_ip)) { %>
for site in foo.zone snonux.land paul.cyou; do
ensure_site \
@@ -34,4 +55,8 @@ for site in foo.zone snonux.land paul.cyou; do
https://codeberg.org/snonux/$site \
content-html
done
+
+ensure_links /var/gemini/paul.cyou buetow.org
+ensure_links /var/gemini/paul.cyou paul.buetow.org
<% } %>
+