mirror of
https://github.com/sunknudsen/privacy-guides.git
synced 2025-02-23 09:13:56 +00:00
32 lines
510 B
Plaintext
32 lines
510 B
Plaintext
|
#!/usr/bin/expect
|
||
|
|
||
|
spawn qr-restore.sh --images "$short_hash_1.jpg,$short_hash_2.jpg" --shamir-secret-sharing --share-threshold 2
|
||
|
|
||
|
expect {
|
||
|
-re {\[sudo\] password for pi:} {
|
||
|
test_send "$env(password)\r"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
expect {
|
||
|
-re {Please type passphrase and press enter} {
|
||
|
test_send "$passphrase\r"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
expect {
|
||
|
-re {Show secret \(y or n\)\?} {
|
||
|
test_send "y\r"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
expect {
|
||
|
-re {Secret:\r\n((.|\r\n)+?)\r\nDone} {
|
||
|
set restored_secret $expect_out(1,string)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
expect {
|
||
|
-re {Done}
|
||
|
}
|