#!/bin/sh # Copyright (C) 2006 OpenWrt.org . /lib/functions.sh . /usr/share/libubox/jshn.sh usage() { cat <&2 echo "WARNING: Wifi detect is deprecated. Use wifi config instead" >&2 echo "For more information, see commit 5f8f8a366136a07df661e31decce2458357c167a" exit 1 } wifi_config() { [ -e /tmp/.config_pending ] && return ucode /usr/share/hostap/wifi-detect.uc [ ! -f /etc/config/wireless ] && touch /etc/config/wireless ucode /lib/wifi/mac80211.uc | uci -q batch for driver in $DRIVERS; do ( if eval "type detect_$driver" 2>/dev/null >/dev/null; then eval "detect_$driver" || echo "$driver: Detect failed" >&2 else echo "$driver: Hardware detection not supported" >&2 fi ); done } DEVICES= DRIVERS= include /lib/wifi case "$1" in down) wifi_updown "disable" "$2";; detect) wifi_detect_notice ;; config) wifi_config ;; status) ubus_wifi_cmd "status" "$2";; isup) wifi_isup "$2"; exit $?;; reload) wifi_reload "$2";; --help|help) usage;; reconf) wifi_updown "reconf" "$2";; ''|up) wifi_updown "enable" "$2";; *) usage; exit 1;; esac