Implemented create-seed feature
This commit is contained in:
parent
495177bd9b
commit
09667692cd
2 changed files with 14 additions and 2 deletions
|
@ -11,10 +11,15 @@ while [[ $# -gt 0 ]]; do
|
|||
"Usage: qr-backup.sh [options]" \
|
||||
"" \
|
||||
"Options:" \
|
||||
" --bip39 test secret against BIP39 word list" \
|
||||
" -h, --help display help for command"
|
||||
" --create-seed create random 24-word BIP39 seed phrase" \
|
||||
" --bip39 test secret against BIP39 word list" \
|
||||
" -h, --help display help for command"
|
||||
exit 0
|
||||
;;
|
||||
--create-seed)
|
||||
create_seed=true
|
||||
shift
|
||||
;;
|
||||
--bip39)
|
||||
bip39=true
|
||||
shift
|
||||
|
@ -65,6 +70,13 @@ if ! mount | grep $usb > /dev/null; then
|
|||
sudo mount $dev $usb -o uid=pi,gid=pi
|
||||
fi
|
||||
|
||||
if [ "$create_seed" = true ]; then
|
||||
printf "%s\n" "Creating random 24-word BIP39 seed phrase…"
|
||||
secret=$(cat "$basedir/bip39.txt" | shuf --head-count 24 --random-source=/dev/urandom --repeat | tr "\n" " ")
|
||||
echo $secret
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
if [ -z "$secret" ]; then
|
||||
tput sc
|
||||
printf "%s\n" "Type secret and press enter"
|
||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue