Fix welcomebot-signups: heredoc instead of -c string to avoid bash/python quote clash
This commit is contained in:
@@ -52,11 +52,11 @@ if ! docker inspect "$CONTAINER" >/dev/null 2>&1; then
|
||||
echo "welcomebot-signups: container '$CONTAINER' not found (is it deployed/running?)" >&2; exit 1
|
||||
fi
|
||||
|
||||
docker exec \
|
||||
docker exec -i \
|
||||
-e SIG_LIMIT="$limit" \
|
||||
-e SIG_FLAGGED_ONLY="$flagged_only" \
|
||||
-e SIG_ACCT="$acct_filter" \
|
||||
"$CONTAINER" python3 -c '
|
||||
"$CONTAINER" python3 <<'PYEOF'
|
||||
import os
|
||||
import sqlite3
|
||||
|
||||
@@ -81,7 +81,11 @@ rows = conn.execute(sql, params).fetchall()
|
||||
if not rows:
|
||||
print("(no matching signup records)")
|
||||
for acct, ip, classification, org, flagged, ipblock, ts in rows:
|
||||
acct = acct or ""
|
||||
ip = ip or ""
|
||||
classification = classification or ""
|
||||
org = org or ""
|
||||
flag = "FLAGGED" if flagged else "-"
|
||||
ipb = "ipblock=yes" if ipblock else "ipblock=no"
|
||||
print(f"{ts} {acct or '':20s} {ip or '':16s} {classification or '':12s} {flag:8s} {ipb:12s} {org or ''}")
|
||||
'
|
||||
print(f"{ts} {acct:20s} {ip:16s} {classification:12s} {flag:8s} {ipb:12s} {org}")
|
||||
PYEOF
|
||||
|
||||
Reference in New Issue
Block a user