Skip to content

Instantly share code, notes, and snippets.

@Jaharmi
Forked from rtrouton/gist:8057983
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save Jaharmi/bf65c645d1cd2d095348 to your computer and use it in GitHub Desktop.

Select an option

Save Jaharmi/bf65c645d1cd2d095348 to your computer and use it in GitHub Desktop.

Revisions

  1. @rtrouton rtrouton created this gist Dec 20, 2013.
    9 changes: 9 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/usr/bin/expect

    log_user 0
    set password s3kr1tp4ssw0rd
    spawn fdesetup changerecovery -personal -key /path/to/keychain_with_both_private_and_public_keys_inside.keychain -outputplist > /path/to/new_recovery_key.plist
    expect "keychain: "
    send "$password\n"
    log_file -a /path/to/new_recovery_key.plist
    expect EOF