yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # script file to start network |
| 4 | # |
| 5 | # Usage: trigger_wps.sh |
| 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 trigger_wps1.sh wifi_wps_index=$ID >>>>>>>>" >> $LOG |
| 17 | |
| 18 | CONFIG_DIR=$CONFIG_ROOT_DIR/wlan0 |
| 19 | WLAN_INTERFACE="wlan0" |
| 20 | |
| 21 | |
| 22 | WPS_MODE=`cat $CONFIG_DIR/wsc_method` |
| 23 | |
| 24 | echo "enter trigger_wps1.sh WPS_MODE=$WPS_MODE >>>>>>>>" >> $LOG |
| 25 | |
| 26 | if [ "$WPS_MODE" = "2" ]; then |
| 27 | echo "wscd -sig_pbc $WLAN_INTERFACE" >> $LOG |
| 28 | wscd -sig_pbc $WLAN_INTERFACE |
| 29 | else |
| 30 | PIN=`cat $CONFIG_DIR/wsc_pin` |
| 31 | echo "iwpriv $WLAN_INTERFACE set_mib pin=$PIN" >> $LOG |
| 32 | iwpriv $WLAN_INTERFACE set_mib pin=$PIN |
| 33 | fi |
| 34 | |