summaryrefslogtreecommitdiff
path: root/frontends/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/scripts')
-rw-r--r--frontends/scripts/gemtexter.sh.tpl36
1 files changed, 36 insertions, 0 deletions
diff --git a/frontends/scripts/gemtexter.sh.tpl b/frontends/scripts/gemtexter.sh.tpl
new file mode 100644
index 0000000..649396b
--- /dev/null
+++ b/frontends/scripts/gemtexter.sh.tpl
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+PATH=$PATH:/usr/local/bin
+
+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
+