However it's probably more stealthy to use diskutil. I'd imagine it's quite rare that even a power user runs fdesetup.
Something like:
fs_type=$(diskutil info / | grep 'File System Personality:' | awk '{print $4}')
if [[ "${fs_type}" == "APFS" ]]; then
enc_volume_info=$(diskutil apfs list | grep -B 6 'FileVault: Yes' )
fi
Then parse the info in $enc_volume_info. Need to double check the commands for HFS(+) and CoreStorage volumes.
This is easily done with
fdesetup
:However it's probably more stealthy to use
diskutil
. I'd imagine it's quite rare that even a power user runsfdesetup
.Something like:
Then parse the info in
$enc_volume_info
. Need to double check the commands for HFS(+) and CoreStorage volumes.