Initial local backup snapshot
This commit is contained in:
commit
acd9e14ba5
367 changed files with 118038 additions and 0 deletions
30
scripts/maintenance-flag.sh
Executable file
30
scripts/maintenance-flag.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
TARGET="${1:-status}"
|
||||
FLAG_PATH="${MAINTENANCE_FLAG_PATH:-$(pwd)/uploads/system/maintenance.flag}"
|
||||
|
||||
mkdir -p "$(dirname "$FLAG_PATH")"
|
||||
|
||||
case "$TARGET" in
|
||||
on|enable)
|
||||
touch "$FLAG_PATH"
|
||||
echo "maintenance=on ($FLAG_PATH)"
|
||||
;;
|
||||
off|disable)
|
||||
rm -f "$FLAG_PATH"
|
||||
echo "maintenance=off ($FLAG_PATH)"
|
||||
;;
|
||||
status)
|
||||
if [[ -f "$FLAG_PATH" ]]; then
|
||||
echo "maintenance=on ($FLAG_PATH)"
|
||||
else
|
||||
echo "maintenance=off ($FLAG_PATH)"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ./scripts/maintenance-flag.sh [on|off|status]" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue