Initial project setup: Docker, Makefile, scripts, plugins

This commit is contained in:
2026-06-17 23:38:59 +02:00
commit c52353ac8e
10 changed files with 397 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
set -e
if [ "$#" -ne 2 ]; then
echo "Usage: server-maintenance.sh on|off <webroot>"
exit 1
fi
MODE="$1"
WEBROOT="$2"
CONFIG="$WEBROOT/user/config/system.yaml"
if [ "$MODE" != "on" ] && [ "$MODE" != "off" ]; then
echo "Usage: server-maintenance.sh on|off <webroot>"
exit 1
fi
[ -f "$CONFIG" ] || { echo "Not found: $CONFIG"; exit 1; }
VALUE="false"
[ "$MODE" = "on" ] && VALUE="true"
if grep -q "^[[:space:]]*offline:" "$CONFIG"; then
sed -i "s/^\([[:space:]]*\)offline: .*/\1offline: $VALUE/" "$CONFIG"
else
printf '\npages:\n offline: %s\n' "$VALUE" >> "$CONFIG"
fi
echo "Maintenance mode: $MODE (offline: $VALUE)"