Skip to content

Commit

Permalink
Check and delete outdated fwkeys (fix #683), also fix #685
Browse files Browse the repository at this point in the history
- i have updated the keys in theapplewiki, they should be correct now
- also run full path for nvram erase all command
  • Loading branch information
LukeZGD committed Feb 25, 2025
1 parent 376114a commit 6bbf780
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2257,17 +2257,18 @@ device_fw_key_check() {
log "Checking firmware keys in $keys_path"
if [[ -e "$keys_path/index.html" ]]; then
if [[ $(cat "$keys_path/index.html" | grep -c "$build") != 1 ]]; then
log "Existing firmware keys are not valid. Deleting"
rm "$keys_path/index.html"
fi
case $build in
1[23]* )
if [[ $(cat "$keys_path/index.html" | sed "s|DeviceTree.${device_model}ap||g" | grep -c "${device_model}ap") != 0 ]]; then
log "Existing firmware keys seem to have incorrect filenames. Deleting"
rm "$keys_path/index.html"
fi
;;
esac
if [[ $(cat "$keys_path/index.html" | grep -c "2025-02-25") != 1 ]]; then
rm "$keys_path/index.html"
fi
fi

if [[ ! -e "$keys_path/index.html" ]]; then
Expand All @@ -2290,6 +2291,7 @@ device_fw_key_check() {
fi
mv index.html "$keys_path/"
fi

if [[ $1 == "base" ]]; then
device_fw_key_base="$(cat $keys_path/index.html)"
elif [[ $1 == "temp" ]]; then
Expand Down Expand Up @@ -6618,7 +6620,7 @@ menu_ramdisk() {
continue
fi
log "Sending command for erasing all content and settings..."
$ssh -p $ssh_port [email protected] "nvram oblit-inprogress=5"
$ssh -p $ssh_port [email protected] "/usr/sbin/nvram oblit-inprogress=5"
log "Done. Reboot to apply changes, or clear NVRAM now to cancel erase"
;;
"remove4" ) device_ramdisk_setnvram;;
Expand Down

0 comments on commit 6bbf780

Please sign in to comment.