X-Git-Url: https://diplodocus.org/git/flac-archive/blobdiff_plain/d491b591c6ebfd1312729f0872b47dcc0f1b972d..f9701ed6e2ad1499f41932b32917d8c8a51e5a34:/fa-rip diff --git a/fa-rip b/fa-rip index 557050d..b45b655 100755 --- a/fa-rip +++ b/fa-rip @@ -3,12 +3,15 @@ # $Id$ set -e -setopt NULL_GLOB -get_cddev () { - local raw +function get_cddev { + typeset raw raw=$(sysctl -n kern.rawpartition > /dev/null | awk '{printf "%c",97+$0}') + if [[ -n ${ZSH_VERSION} ]]; then + setopt NULL_GLOB + fi + for CDDEV in /dev/{cdroms/cdrom*,cdrom*,rcd*${raw},{a,}cd*c}; do [[ -e ${CDDEV} ]] && return 0 done @@ -18,7 +21,7 @@ get_cddev () { if [[ -z ${CDDEV} ]]; then if ! get_cddev; then - echo 'CDDEV environment variable not set, defaults did not work' + echo 'CDDEV environment variable not set, defaults did not work' >&2 exit 2 fi export CDDEV