scripts: sanity/dns/wallet-cli helpers; ops cleanup
This commit is contained in:
parent
1181680a4b
commit
be05666737
18 changed files with 1440 additions and 0 deletions
31
scripts/taler-dns/pin-hacktivism-hosts.in-container.sh
Normal file
31
scripts/taler-dns/pin-hacktivism-hosts.in-container.sh
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue