| echo "Push button on the station within two minutes" |
| if ! $CLI wps_pbc | grep -q OK; then |
| echo "Failed to enable PBC mode" |
| echo "Enter a PIN from a station to be enrolled to the network." |
| read -p "Enrollee PIN: " pin |
| cpin=`$CLI wps_check_pin "$pin" | tail -1` |
| if [ "$cpin" = "FAIL-CHECKSUM" ]; then |
| echo "Checksum digit is not valid" |
| read -p "Do you want to use this PIN (y/n)? " resp |
| cpin=`echo "$pin" | sed "s/[^1234567890]//g"` |
| if [ "$cpin" = "FAIL" ]; then |
| echo "Enabling Enrollee PIN: $cpin" |
| echo "1: Push button (activate PBC)" |
| echo "2: Enter Enrollee PIN" |
| echo "3: Show current configuration" |
| echo "0: Exit wps-ap-cli" |
| echo "Unknown command: $cmd" |