treewide: use consistent echo message formatting

Quote the echo message.
This commit is contained in:
Erik Arvstedt 2021-08-15 11:28:36 +02:00
parent b8043d3db5
commit f14af1fc48
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
2 changed files with 7 additions and 7 deletions

View File

@ -214,24 +214,24 @@ in {
if [[ ! -f ${networkDir}/wallet.db ]]; then if [[ ! -f ${networkDir}/wallet.db ]]; then
mnemonic="${cfg.dataDir}/lnd-seed-mnemonic" mnemonic="${cfg.dataDir}/lnd-seed-mnemonic"
if [[ ! -f "$mnemonic" ]]; then if [[ ! -f "$mnemonic" ]]; then
echo Create lnd seed echo "Create lnd seed"
umask u=r,go= umask u=r,go=
${curl} -X GET ${restUrl}/genseed | ${pkgs.jq}/bin/jq -c '.cipher_seed_mnemonic' > "$mnemonic" ${curl} -X GET ${restUrl}/genseed | ${pkgs.jq}/bin/jq -c '.cipher_seed_mnemonic' > "$mnemonic"
fi fi
echo Create lnd wallet echo "Create lnd wallet"
${curl} --output /dev/null \ ${curl} --output /dev/null \
-X POST -d "{\"wallet_password\": \"$(cat ${secretsDir}/lnd-wallet-password | tr -d '\n' | base64 -w0)\", \ -X POST -d "{\"wallet_password\": \"$(cat ${secretsDir}/lnd-wallet-password | tr -d '\n' | base64 -w0)\", \
\"cipher_seed_mnemonic\": $(cat "$mnemonic" | tr -d '\n')}" \ \"cipher_seed_mnemonic\": $(cat "$mnemonic" | tr -d '\n')}" \
${restUrl}/initwallet ${restUrl}/initwallet
# Guarantees that RPC calls with cfg.cli succeed after the service is started # 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 while [[ ! -f ${networkDir}/admin.macaroon ]]; do
sleep 0.1 sleep 0.1
done done
else else
echo Unlock lnd wallet echo "Unlock lnd wallet"
${curl} \ ${curl} \
-H "Grpc-Metadata-macaroon: $(${pkgs.xxd}/bin/xxd -ps -u -c 99999 '${networkDir}/admin.macaroon')" \ -H "Grpc-Metadata-macaroon: $(${pkgs.xxd}/bin/xxd -ps -u -c 99999 '${networkDir}/admin.macaroon')" \
-X POST \ -X POST \

View File

@ -10,7 +10,7 @@ let
pay_tallycoin() { pay_tallycoin() {
NAME=$1 NAME=$1
AMOUNT=$2 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 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 if [ -z "$INVOICE" ] || [ "$INVOICE" = "null" ]; then
echo "ERROR: did not get invoice from tallycoin" echo "ERROR: did not get invoice from tallycoin"
@ -23,10 +23,10 @@ let
return return
fi fi
if [ $DECODED_AMOUNT -eq $AMOUNT ]; then if [ $DECODED_AMOUNT -eq $AMOUNT ]; then
echo Paying with invoice "$INVOICE" echo "Paying with invoice $INVOICE"
$LNCLI pay "$INVOICE" $LNCLI pay "$INVOICE"
else 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 return
fi fi
} }