Linux/Ubuntu: detect if CD/DVD disk ispresent and is writeable

PHOTO EMBED

Sun Aug 28 2022 12:50:20 GMT+0000 (Coordinated Universal Time)

Saved by @marcopinero #bash

#Use udisks utility
#sudo apt-get install udisks

$> udisks --show-info /dev/sr0 | grep -c "blank: *1"

#this will return 0:if not blank/present; or 1:blank disk present
content_copyCOPY