scripts: sanity/dns/wallet-cli helpers; ops cleanup

This commit is contained in:
Hernâni Marques 2026-07-09 19:57:14 +02:00
parent 1181680a4b
commit be05666737
No known key found for this signature in database
18 changed files with 1440 additions and 0 deletions

View file

@ -0,0 +1,31 @@
#!/bin/bash
# Runs *inside* a Taler container. Pasta regenerates /etc/hosts on start —
# call this from systemd (exchange) or start_base_*.sh (merchant/bank).
set -euo pipefail
PIN_IP="${PIN_IP:-212.51.151.254}"
MARKER="# hacktivism-goa-pin"
TMP=$(mktemp)
if [ -f /etc/hosts ]; then
# drop any previous pin marker lines and lines that name our domains
grep -vE "${MARKER}|hacktivism\\.ch" /etc/hosts >"$TMP" || true
else
: >"$TMP"
fi
grep -qE '^127\.0\.0\.1[[:space:]]' "$TMP" 2>/dev/null \
|| echo '127.0.0.1 localhost' >>"$TMP"
grep -qE '^::1[[:space:]]' "$TMP" 2>/dev/null \
|| echo '::1 localhost ip6-localhost ip6-loopback' >>"$TMP"
{
cat "$TMP"
echo "$MARKER"
echo "${PIN_IP} bank.hacktivism.ch exchange.hacktivism.ch taler.hacktivism.ch"
echo "$MARKER"
} > /etc/hosts
rm -f "$TMP"
logger -t pin-hacktivism-hosts "pinned ${PIN_IP} → bank/exchange/taler.hacktivism.ch" 2>/dev/null || true
exit 0