--- rfkill 2013-11-17 09:37:39.000000000 +0000 +++ rfkill-fixed 2014-01-26 19:08:59.197914010 +0000 @@ -26,35 +26,23 @@ return 1 } -## Determine the blocking status of an rfkill device +## Unblock transmission through a wireless device # $1: interface name # $2: rfkill name -rf_status() { +rf_enable() { local path path=$(rf_get_path "$@") || return 1 if (( $(< "$path/hard" ) )); then - echo "hard" - elif (( $(< "$path/soft" ) )); then - echo "soft" - fi -} - -## Unblock transmission through a wireless device -# $1: interface name -# $2: rfkill name -rf_enable() { - case $(rf_status "$@") in - hard) report_error "Transmission is hard-blocked on interface '$interface'" return 1 - ;; - soft) + fi + + if (( $(< "$path/soft" ) )); then report_debug "$FUNCNAME: echo 0 > '$path/soft'" echo 0 > "$path/soft" timeout_wait 1 '(( ! $(< "$path/soft") ))' - ;; - esac + fi } ## Block transmission through a wireless device