mirror of
https://github.com/jb55/nostril.git
synced 2024-12-24 11:15:51 -05:00
cleanup scripts
This commit is contained in:
parent
0ee25a0afa
commit
f9ec1d1aa3
|
@ -1,2 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
echo '["REQ","",{"kinds":[0],"authors":["'$1'"]}]'
|
|
@ -1,2 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
websocat "$@" wss://relay.damus.io
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
jq -c '["EVENT",.]' | websocat wss://relay.damus.io
|
|
@ -19,11 +19,19 @@ if [[ "$content" =~ $re ]]; then
|
|||
exit 2
|
||||
fi
|
||||
|
||||
note=$(nostril "$@" --content "$content")
|
||||
sec=""
|
||||
if command -v git; then
|
||||
key=$(git config nostr.secretkey)
|
||||
if [ $key != "" ]; then
|
||||
sec="--sec $key"
|
||||
fi
|
||||
fi
|
||||
|
||||
note=$(nostril --envelope $sec "$@" --content "$content")
|
||||
|
||||
printf "relaying:\n" >&2
|
||||
printf "$note\n"
|
||||
<<<"$note" nostr-relay-note
|
||||
<<<"$note" nostril relay
|
||||
printf "done.\n" >&2
|
||||
|
||||
rm -f "$TMP"
|
17
scripts/nostril-relay
Executable file
17
scripts/nostril-relay
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
relays=${NOSTR_RELAYS:-$(git config nostr.relays)}
|
||||
relayer=${NOSTR_RELAYER:-nostcat}
|
||||
to_stdout=0
|
||||
|
||||
if ! command -v $relayer; then
|
||||
printf "nostr relayer '%s' not found. Please install or set NOSTR_RELAYER to your preferred relayer.\n" "$relayer"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$relays" == "" ]; then
|
||||
printf 'no relays set. set\n\n export NOSTR_RELAYS="wss://relay1.com wss://relay2.com ..." or\n\n git config --global --add nostr.relays "wss://relay1.com wss://relay2.com"\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$relayer $relays
|
Loading…
Reference in New Issue
Block a user