-
Notifications
You must be signed in to change notification settings - Fork 1
/
patch_plists.sh
executable file
·34 lines (26 loc) · 983 Bytes
/
patch_plists.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
echo "Patching configs w/ serials"
source serials.sh
if [ ! -d ./output ]; then mkdir ./output; fi && cd ./output
if [ ! -d ./efi ]; then mkdir ./efi; fi
cd ../
cd ./configs/
for f in config*.plist; do
cp $f ../output/efi/${f}
done
cd ../output/efi/
for f in config*.plist; do
/usr/libexec/PlistBuddy -c "Delete :SMBIOS:SmUUID" $f
/usr/libexec/PlistBuddy -c "Delete :SMBIOS:SerialNumber" $f
/usr/libexec/PlistBuddy -c "Delete :SMBIOS:BoardSerialNumber" $f
/usr/libexec/PlistBuddy -c "Delete :RtVariables:MLB" $f
/usr/libexec/PlistBuddy -c "Delete :RtVariables:ROM" $f
/usr/libexec/PlistBuddy -c "Add :SMBIOS:SmUUID string $UUID" $f
/usr/libexec/PlistBuddy -c "Add :SMBIOS:SerialNumber string $SN" $f
/usr/libexec/PlistBuddy -c "Add :SMBIOS:BoardSerialNumber string $MLB" $f
/usr/libexec/PlistBuddy -c "Add :RtVariables:MLB string $MLB" $f
/usr/libexec/PlistBuddy -c "Add :RtVariables:ROM data $ROM" $f
done
cd ../../
echo ""
echo ""