summaryrefslogtreecommitdiffstats
path: root/monitor.sh
blob: 5fb849380e3d5b256991116190e309635d976a06 (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
	ifconfig wlan0 channel $1
fi
ifconfig wlan0 down
iwconfig wlan0 mode monitor
ifconfig wlan0 up