2018-11-22 23:51:16 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
SECRETSFILE=secrets/secrets.nix
|
|
|
|
|
|
|
|
if [ -e "$SECRETSFILE" ]; then
|
|
|
|
echo $SECRETSFILE already exists
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo Installing apg through nix-env
|
|
|
|
nix-env -i apg
|
2018-12-01 16:36:07 +00:00
|
|
|
echo Write secrets to $SECRETSFILE
|
|
|
|
{
|
|
|
|
echo \{
|
|
|
|
echo " bitcoinrpcpassword = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
|
|
|
|
echo " lightning-charge-api-token = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
|
2018-12-03 22:33:21 +00:00
|
|
|
echo " liquidrpcpassword = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
|
2018-12-01 16:36:07 +00:00
|
|
|
echo \}
|
|
|
|
} >> $SECRETSFILE
|
2018-11-22 23:51:16 +00:00
|
|
|
echo Done
|