-
Notifications
You must be signed in to change notification settings - Fork 0
/
scan.sh
executable file
·39 lines (34 loc) · 1.05 KB
/
scan.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
local if_name=$(cat /proc/net/dev | sed -n -e 's/:.*//' -e 's/[ /t]*//' -e '/^wlan[0-9]$/p')
if [ $1 == ${if_name} ]
then
if [ $2 == c ]
then
iwinfo ${if_name} s|grep -A3 -B3 "Channel: ${3}"
elif [ $2 != c ]
then
iwinfo ${if_name} s|grep -A4 -B2 "$2"
elif [ -z $2 ]
then
echo "Insert SSID [ENTER]"
read ssid
iwinfo ${if_name} s|grep -A4 -B2 $ssid
fi
else
echo "Your wifi interface: '${if_name}'"
echo "Insert interface name [ENTER]"
read if_sel
if [ $1 == c ]
then
iwinfo ${if_sel} s|grep -A3 -B3 "Channel: ${2}"
elif [ $1 != c ]
then
iwinfo ${if_sel} s|grep -A4 -B2 "$1"
elif [ -z $1 ]
then
echo "Insert SSID [ENTER]"
read ssid
iwinfo ${if_sel} s|grep -A4 -B2 $ssid
fi
fi
exit 0