#!/bin/bash AUTH=xuu:zero-punish-whenever-swell SSH_PUB=~/.ssh/id_ed25519.pub MERCURY_URL=localhost:4088/v1/mercury/config AUTHFILE=$(mktemp) CFGFILE=$(mktemp) SIGFILE=$(mktemp) (echo -n "user "; cat "$SSH_PUB") > "$AUTHFILE" http \ --auth "$AUTH" \ GET "$MERCURY_URL" \ space=="$1" |\ tee "$CFGFILE" |\ sed -n '/^----/,$p' > "$SIGFILE" sed '/^----/,$d' "$CFGFILE" |\ ssh-keygen -Y verify \ -f "$AUTHFILE" \ -I user \ -n file \ -s "$SIGFILE" rm "$AUTHFILE" "$SIGFILE" "$CFGFILE"