mirror of
https://github.com/sunknudsen/privacy-guides.git
synced 2025-02-23 09:13:56 +00:00
Implemented create-seed feature
This commit is contained in:
parent
495177bd9b
commit
09667692cd
@ -11,10 +11,15 @@ while [[ $# -gt 0 ]]; do
|
||||
"Usage: qr-backup.sh [options]" \
|
||||
"" \
|
||||
"Options:" \
|
||||
" --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…
x
Reference in New Issue
Block a user