summaryrefslogtreecommitdiffstats
path: root/monitor.sh
blob: 9a98099b4c1e7339c34858caaef12edb93d204ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if [[ $UID != 0 ]]; then
	echo "You must be root."
	exit -1
fi
systemctl stop dhcpcd.service
systemctl stop wpa_supplicant@wlan0.service
if [ $# -eq 1 ]; then
	ifconfig wlan0 down
	iwconfig wlan0 mode managed
	ifconfig wlan0 up
	iwconfig wlan0 channel $1
fi
ifconfig wlan0 down
iwconfig wlan0 mode monitor
ifconfig wlan0 up