projects
/
headersdns
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
688d6f7
)
Tweak script slightly
author
Matt Corallo
<git@bluematt.me>
Mon, 25 Jul 2022 04:23:53 +0000
(
04:23
+0000)
committer
Matt Corallo
<git@bluematt.me>
Mon, 25 Jul 2022 04:26:31 +0000
(
04:26
+0000)
headersdns.sh
patch
|
blob
|
history
diff --git
a/headersdns.sh
b/headersdns.sh
index 4d8cabd00f865f4442d364875d85c6160f0748f6..bc5a995443fca7ed5a417d37415b289f8df06637 100644
(file)
--- a/
headersdns.sh
+++ b/
headersdns.sh
@@
-22,12
+22,15
@@
# It is important that your secondary nameserver(s) support NOTIFYs to ensure you can
# update them as new blocks come in.
# It is important that your secondary nameserver(s) support NOTIFYs to ensure you can
# update them as new blocks come in.
+set -e
+
SCP_TARGET="user@hostname"
BITCOIN_CLI="~/bitcoin-cli"
BITCOIND_REST="http://127.0.0.1/rest"
mkdir -p header_zones
cc -Wall -O2 ./split.c -o split
SCP_TARGET="user@hostname"
BITCOIN_CLI="~/bitcoin-cli"
BITCOIND_REST="http://127.0.0.1/rest"
mkdir -p header_zones
cc -Wall -O2 ./split.c -o split
+cd header_zones
while [ true ]; do
if [ "$LATEST_HASH" != "$($BITCOIN_CLI getbestblockhash)" ]; then
while [ true ]; do
if [ "$LATEST_HASH" != "$($BITCOIN_CLI getbestblockhash)" ]; then
@@
-50,10
+53,10
@@
while [ true ]; do
# split returns non-0 on error or if the zone on disk ends with the same header
# as what we just provided, so only scp it to our nameserver if we get 0
# split returns non-0 on error or if the zone on disk ends with the same header
# as what we just provided, so only scp it to our nameserver if we get 0
- if echo "$HEADERS" | ./split $I $COUNT 80 headers-$(($I / 10000)).zone; then
+ if echo "$HEADERS" | .
.
/split $I $COUNT 80 headers-$(($I / 10000)).zone; then
echo -e "put headers-$(($I / 10000)).zone dest/\nquit\n" | sftp $SCP_TARGET
fi
echo -e "put headers-$(($I / 10000)).zone dest/\nquit\n" | sftp $SCP_TARGET
fi
- if echo "$FILTERS" | ./split $I $COUNT 32 filterheaders-$(($I / 10000)).zone; then
+ if echo "$FILTERS" | .
.
/split $I $COUNT 32 filterheaders-$(($I / 10000)).zone; then
echo -e "put filterheaders-$(($I / 10000)).zone dest/\nquit\n" | sftp $SCP_TARGET
fi
done
echo -e "put filterheaders-$(($I / 10000)).zone dest/\nquit\n" | sftp $SCP_TARGET
fi
done