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]" \
|
"Usage: qr-backup.sh [options]" \
|
||||||
"" \
|
"" \
|
||||||
"Options:" \
|
"Options:" \
|
||||||
" --bip39 test secret against BIP39 word list" \
|
" --create-seed create random 24-word BIP39 seed phrase" \
|
||||||
" -h, --help display help for command"
|
" --bip39 test secret against BIP39 word list" \
|
||||||
|
" -h, --help display help for command"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
--create-seed)
|
||||||
|
create_seed=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--bip39)
|
--bip39)
|
||||||
bip39=true
|
bip39=true
|
||||||
shift
|
shift
|
||||||
@ -65,6 +70,13 @@ if ! mount | grep $usb > /dev/null; then
|
|||||||
sudo mount $dev $usb -o uid=pi,gid=pi
|
sudo mount $dev $usb -o uid=pi,gid=pi
|
||||||
fi
|
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
|
if [ -z "$secret" ]; then
|
||||||
tput sc
|
tput sc
|
||||||
printf "%s\n" "Type secret and press enter"
|
printf "%s\n" "Type secret and press enter"
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user