daily backup 2026-09-14

This commit is contained in:
Adolfo Reyna
2026-09-14 22:40:15 -04:00
parent 30f9148adb
commit 4fe483f68f
12 changed files with 199 additions and 16 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/bin/sh
set -eu
HOST="elias.reynafamily.com"
ROUTE_JSON="/home/adolforeyna/elias-caddy-route.json"
API="http://127.0.0.1:2019/config/apps/http/servers/srv2/routes"
INDEX=$(curl -fsS "$API" | python3 -c '
import json, sys
host = sys.argv[1]
routes = json.load(sys.stdin)
for index, route in enumerate(routes):
if any(host in match.get("host", []) for match in route.get("match", [])):
print(index)
break
' "$HOST")
if [ -n "$INDEX" ]; then
curl -fsS -X DELETE "$API/$INDEX"
fi
curl -fsS -X POST -H "Content-Type: application/json" --data-binary "@$ROUTE_JSON" "$API"