#!/bin/bash ## PREPARE THE WIRELESS INTERFACES echo "Preparing Wireless Interfaces" >> /tmp/log/interfacelog.log wlanconfig ath0 destroy sleep 2 wlanconfig ath0 create wlandev wifi0 wlanmode adhoc sleep 2 iwconfig ath0 txpower 1 sleep 2 ifconfig ath0 up iwpriv ath0 mode 11g ## Important: add this always to your experiment, to make sure not to struggle with antenna diversity issues sysctl -w dev.wifi0.diversity=0 sysctl -w dev.wifi0.txantenna=1 sysctl -w dev.wifi0.rxantenna=1 echo "Done preparing Wireless interfaces " >> /tmp/log/interfacelog.log ifconfig ath0 >> /tmp/log/interfacelog.log