blob: c020f1a6248a1e681a6534243cf37658a2702ede [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001#!/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
9ROOT=`nv get wifi_root_dir`
10
11LOG=$ROOT/wifi/realtek/slog
12CONFIG_ROOT_DIR="$ROOT/wifi/realtek/rtl8192c"
13CONFIG_DIR=$CONFIG_ROOT_DIR/wlan0
14
15ID=`nv get wifi_wps_index`
16echo "enter trigger_wps1.sh wifi_wps_index=$ID >>>>>>>>" >> $LOG
17
18CONFIG_DIR=$CONFIG_ROOT_DIR/wlan0
19WLAN_INTERFACE="wlan0"
20
21
22WPS_MODE=`cat $CONFIG_DIR/wsc_method`
23
24echo "enter trigger_wps1.sh WPS_MODE=$WPS_MODE >>>>>>>>" >> $LOG
25
26if [ "$WPS_MODE" = "2" ]; then
27 echo "wscd -sig_pbc $WLAN_INTERFACE" >> $LOG
28 wscd -sig_pbc $WLAN_INTERFACE
29else
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
33fi
34