treewide: use consistent echo message formatting
Quote the echo message.
This commit is contained in:
parent
b8043d3db5
commit
f14af1fc48
@ -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 \
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user