local -a rfkill
local rf
[[ -e /sys/class/net ]] || return 0 # we can't tell anything, so let it run, maybe it'll work
[[ -e /sys/class/net/$iface ]] || return 1 # no interface of such name
rfkill=( /sys/class/net/$iface/*/rfkill*(N) )
for rf in $rfkill; do
if [[ -e $rf/hard ]]; then
(($(<$rf/hard))) && return 1
fi
if [[ -e $rf/soft ]]; then
(($(<$rf/soft))) && return 1
fi
done
return 0 # no rfkill present
# vim: ft=zsh noet ts=4 sts=4 sw=4