yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # script file to start network |
| 4 | # |
| 5 | # Usage: kill_wps.sh {pbc | pin} {PINNUM} |
| 6 | # |
| 7 | |
| 8 | ##if [ $# -lt 2 ]; then echo "Usage: $0 {gw | ap} {all | bridge | wan}"; exit 1 ; fi |
| 9 | ROOT=`nv get wifi_root_dir` |
| 10 | |
| 11 | LOG=$ROOT/wifi/realtek/slog |
| 12 | CONFIG_ROOT_DIR="$ROOT/wifi/realtek/rtl8192c" |
| 13 | CONFIG_DIR=$CONFIG_ROOT_DIR/wlan0 |
| 14 | |
| 15 | ID=`nv get wifi_wps_index` |
| 16 | echo "enter kill_wps.sh wifi_wps_index=$ID >>>>>>>>" >> $LOG |
| 17 | ID=`expr $ID - 1` |
| 18 | echo "enter kill_wps.sh ID=$ID >>>>>>>>" >> $LOG |
| 19 | |
| 20 | if [ "$ID" = "0" ];then |
| 21 | #CONFIG_DIR=$CONFIG_ROOT_DIR/wlan0 |
| 22 | #WLAN_INTERFACE="wlan0" |
| 23 | CONFIG_DIR=$CONFIG_ROOT_DIR/wlan0-va$ID |
| 24 | WLAN_INTERFACE="wlan0-va$ID" |
| 25 | else |
| 26 | CONFIG_DIR=$CONFIG_ROOT_DIR/wlan0-va$ID |
| 27 | WLAN_INTERFACE="wlan0-va$ID" |
| 28 | fi |
| 29 | |
| 30 | |
| 31 | if [ -z "$SCRIPT_DIR" ]; then |
| 32 | SCRIPT_DIR=`cat $CONFIG_ROOT_DIR/wifi_script_dir` |
| 33 | fi |
| 34 | START_WLAN_APP=$SCRIPT_DIR/wlanapp_8192c.sh |
| 35 | |
| 36 | BR_INTERFACE="br0" |
| 37 | echo "<<<${START_WLAN_APP##*/} start $WLAN_INTERFACE $VIRTUAL_WLAN_INTERFACE $BR_INTERFACE>>>" >> $LOG |
| 38 | $START_WLAN_APP kill $WLAN_INTERFACE $VIRTUAL_WLAN_INTERFACE $BR_INTERFACE |
| 39 | ERR=`echo $?` |
| 40 | if [ $ERR != 0 ]; then |
| 41 | exit $ERR; |
| 42 | fi |