if [[ $UID != 0 ]]; then echo "You must be root." exit -1 fi /etc/init.d/dhcpcd stop /etc/init.d/wpa_supplicant stop if [ $# -eq 1 ]; then ifconfig wlan0 down iwconfig wlan0 mode managed ifconfig wlan0 up iwconfig wlan0 freq $1 fi ifconfig wlan0 down iwconfig wlan0 mode monitor ifconfig wlan0 up