mirror of
https://github.com/Retropex/knots-startos.git
synced 2025-05-12 19:30:45 +02:00
29 lines
551 B
Bash
29 lines
551 B
Bash
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cat > input.json
|
|
|
|
URL=$(jq -r '.["location"]' input.json)
|
|
|
|
rm input.json
|
|
|
|
mkdir -p /tmp/snap
|
|
|
|
if [ -e "/tmp/snap/snapshot" ]; then
|
|
bitcoin-cli loadtxoutset /tmp/snap/snapshot &
|
|
else
|
|
wget -q $URL -O /tmp/snap/snapshot
|
|
bitcoin-cli loadtxoutset /tmp/snap/snapshot &
|
|
fi
|
|
|
|
result=" {
|
|
\"version\": \"0\",
|
|
\"message\": \"Consult the logs to see the progression of the snapshot loading. / DO NOT RESTART UNTIL THE SNAPSHOT IS LOADED.\",
|
|
\"value\": null,
|
|
\"copyable\": false,
|
|
\"qr\": false
|
|
}"
|
|
|
|
echo $result
|