generate_secrets.sh: extract makepw command

This makes it obvious that all passwords are generated with the same parameters
This commit is contained in:
Erik Arvstedt 2019-11-27 14:04:28 +01:00
parent e3b47ce18a
commit 51fb054001
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -4,13 +4,14 @@ SECRETSFILE=secrets/secrets.nix
if [ ! -e "$SECRETSFILE" ]; then
echo Write secrets to $SECRETSFILE
makepw="apg -m 20 -x 20 -M Ncl -n 1"
{
echo \{
echo " bitcoinrpcpassword = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
echo " lnd-wallet-password = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
echo " lightning-charge-api-token = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
echo " liquidrpcpassword = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
echo " spark-wallet-password = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
echo " bitcoinrpcpassword = \"$($makepw)\";"
echo " lnd-wallet-password = \"$($makepw)\";"
echo " lightning-charge-api-token = \"$($makepw)\";"
echo " liquidrpcpassword = \"$($makepw)\";"
echo " spark-wallet-password = \"$($makepw)\";"
echo \}
} >> $SECRETSFILE
echo Done