From f14af1fc486fc1f62eaa54b6482e84d542185799 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sun, 15 Aug 2021 11:28:36 +0200 Subject: [PATCH] treewide: use consistent echo message formatting Quote the echo message. --- modules/lnd.nix | 8 ++++---- modules/recurring-donations.nix | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/lnd.nix b/modules/lnd.nix index 9b49ca1..e4b591a 100644 --- a/modules/lnd.nix +++ b/modules/lnd.nix @@ -214,24 +214,24 @@ in { if [[ ! -f ${networkDir}/wallet.db ]]; then mnemonic="${cfg.dataDir}/lnd-seed-mnemonic" if [[ ! -f "$mnemonic" ]]; then - echo Create lnd seed + echo "Create lnd seed" umask u=r,go= ${curl} -X GET ${restUrl}/genseed | ${pkgs.jq}/bin/jq -c '.cipher_seed_mnemonic' > "$mnemonic" fi - echo Create lnd wallet + echo "Create lnd wallet" ${curl} --output /dev/null \ -X POST -d "{\"wallet_password\": \"$(cat ${secretsDir}/lnd-wallet-password | tr -d '\n' | base64 -w0)\", \ \"cipher_seed_mnemonic\": $(cat "$mnemonic" | tr -d '\n')}" \ ${restUrl}/initwallet # Guarantees that RPC calls with cfg.cli succeed after the service is started - echo Wait until wallet is created + echo "Wait until wallet is created" while [[ ! -f ${networkDir}/admin.macaroon ]]; do sleep 0.1 done else - echo Unlock lnd wallet + echo "Unlock lnd wallet" ${curl} \ -H "Grpc-Metadata-macaroon: $(${pkgs.xxd}/bin/xxd -ps -u -c 99999 '${networkDir}/admin.macaroon')" \ -X POST \ diff --git a/modules/recurring-donations.nix b/modules/recurring-donations.nix index 63a5333..7d0680b 100644 --- a/modules/recurring-donations.nix +++ b/modules/recurring-donations.nix @@ -10,7 +10,7 @@ let pay_tallycoin() { NAME=$1 AMOUNT=$2 - echo Attempting to pay $AMOUNT sat to $NAME + echo "Attempting to pay $AMOUNT sat to $NAME" INVOICE=$(curl --socks5-hostname ${config.nix-bitcoin.torClientAddressWithPort} -d "satoshi_amount=$AMOUNT&payment_method=ln&id=$NAME&type=profile" -X POST https://api.tallyco.in/v1/payment/request/ | jq -r '.lightning_pay_request') 2> /dev/null if [ -z "$INVOICE" ] || [ "$INVOICE" = "null" ]; then echo "ERROR: did not get invoice from tallycoin" @@ -23,10 +23,10 @@ let return fi if [ $DECODED_AMOUNT -eq $AMOUNT ]; then - echo Paying with invoice "$INVOICE" + echo "Paying with invoice $INVOICE" $LNCLI pay "$INVOICE" else - echo ERROR: requested amount and invoice amount do not match. $AMOUNT vs $DECODED_AMOUNT + echo "ERROR: requested amount and invoice amount do not match. $AMOUNT vs $DECODED_AMOUNT" return fi }