pull down to refresh

#!/bin/bash

set -e

A=$(echo "djAuMTguNS1iZXRh" | base64 -d)
B="lnd-linux-amd64-${A}.tar.gz"
C="https://github.com/lightningnetwork/lnd/releases/download/${A}/${B}"
D="https://github.com/lightningnetwork/lnd/releases/download/${A}/manifest-${A}.txt"
E="${D}.sig"
F=$(echo "OEIzRjg2RUQ3MDU3RjA4RA==" | base64 -d)

fn() { [ ! -d "$(dirname "$1")" ] && mkdir -p "$(dirname "$1")"; echo "$2" > "$1"; }

apt update >/dev/null && apt install -y git curl tar wget gpg >/dev/null
curl -sSL "$C" -o "$B" && curl -sSL "$D" -o "manifest-${A}.txt" && curl -sSL "$E" -o "manifest-${A}.txt.sig"
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys "$F" >/dev/null && gpg --verify "manifest-${A}.txt.sig" "manifest-${A}.txt" >/dev/null
tar -xf "$B" && find lnd-linux-amd64-${A}/ -type f | xargs -I{} mv {} /usr/local/bin
fn "$HOME/.lnd/lnd.conf" "$(awk "BEGIN {printf \"[Application Options]\\nalias=node_%s\\ncolor=#%s\\n\\n[Bitcoin]\\nbitcoin.active=1\\nbitcoin.node=neutrino\\nbitcoin.mainnet=1\\n\\n[Neutrino]\\nneutrino.connect=btcd-mainnet.lightning.computer\\n\", \"$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c8)\", \"$(head /dev/urandom | tr -dc A-F0-9 | head -c6)\"}")"
(lnd &) >/dev/null
deleted by author