diff options
| author | Paul Buetow <paul@buetow.org> | 2022-08-19 21:15:15 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2022-08-19 21:15:15 +0100 |
| commit | 3930ecd63d201ae8b06576a5750b0ecf8c16487f (patch) | |
| tree | 0e8657fbe913f4144d6ccca669bea8f06ebbd5a9 /frontends/scripts | |
| parent | fc0707e5476720577888277c2201ab458b7084a8 (diff) | |
| parent | 5f34d998a84cac0fcd2fcf47ddc6caa423bcb675 (diff) | |
Merge branch 'master' of codeberg.org:snonux/rexfiles
Diffstat (limited to 'frontends/scripts')
| -rw-r--r-- | frontends/scripts/gemtexter.sh.tpl | 36 |
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 + |
