Can anyone shed some light on why my code below is not working? It's not very complicated... but I believe it's because the firmwarepasswd -check is returning a result with a carriage return, but despite using tr and sed to strip the return or new line, the if statement always returns false. any help would be appreciated!
!/bin/bash
result= /usr/sbin/firmwarepasswd -check
echo $result
if [[ $result = "Password Enabled: No" ]] ; then
/usr/local/bin/jamf policy -trigger setefi
sudo shutdown -r +1
else
echo "EFI already set"
fi
exit 0