summaryrefslogtreecommitdiff
path: root/frontends/scripts
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2022-08-04 22:17:54 +0300
committerPaul Buetow <paul@buetow.org>2022-08-04 22:17:54 +0300
commit3f005c6ef3f35087221051afc4a70a4deb104c91 (patch)
tree10d7dc6992fb34de3811c069d515958688a3df46 /frontends/scripts
parent23b88eada5e53e408a369e67bab58a7fc61a52f1 (diff)
add gemtexter.sh updater
Diffstat (limited to 'frontends/scripts')
-rw-r--r--frontends/scripts/gemtexter.sh.tpl34
1 files changed, 34 insertions, 0 deletions
diff --git a/frontends/scripts/gemtexter.sh.tpl b/frontends/scripts/gemtexter.sh.tpl
new file mode 100644
index 0000000..a5a0aba
--- /dev/null
+++ b/frontends/scripts/gemtexter.sh.tpl
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+function ensure_site {
+ dir=$1
+ repo=$2
+ branch=$3
+
+ basename=$(basename $dir)
+ parent=$(dirname $dir)
+
+ if [ ! -d $parent ]; then
+ mkdir -p $parent
+ fi
+
+ cd $parent
+ if [ ! -d $basename ]; then
+ git clone $repo -b $branch --single-branch $basename
+ else
+ cd $basename
+ git pull
+ fi
+}
+
+for site in foo.zone snonux.land; do
+ ensure_site \
+ /var/gemini/$site \
+ https://codeberg.org/snonux/$site \
+ content-gemtext
+ ensure_site \
+ /var/www/htdocs/gemtexter/$site \
+ https://codeberg.org/snonux/$site \
+ content-html
+done
+