#!/bin/sh a=$(/usr/sbin/ioreg -w0 -l -rd1 -n AppleBCMWLANCore | grep ModuleDictionary | awk '{print $4}' | cut -d'=' -f2 | sed 's/\./\\./g') vendor=$(/usr/sbin/ioreg -w0 -l -rd1 -n AppleBCMWLANCore | grep ModuleDictionary | awk '{print $5}' | cut -d"\"" -f1) c=$(cat /AppleInternal/Diags/WiFiFirmware/J34/WifiFirmware.prm | grep "$a" | grep "$vendor" | awk '{print $5}') loc="/AppleInternal/Diags/WiFiFirmware/J34/"; filename=$(echo $c | cut -d'.' -f1) exts=$(echo $c | cut -d'.' -f2) newfname=$filename"-orig."$exts mv $loc$newfname $loc$c