分类:
2009-06-19 23:14:19
################ adhoc ####################
ifconfig br0 down
brctl delbr br0
brctl addbr br0
hostapd -B -dd /etc/hostapd.conf
brctl addif br0 wlan0
ifconfig br0 192.168.10.115
#rm /etc/hostapd.conf
#rm /etc/wpa_supplicant.conf
if [ "$aporsta" == "0" ]; then
ifconfig br0 down > /dev/null 2>&1
brctl delbr br0 > /dev/null 2>&1
/sbin/set_hostapd_config.sh
cp /wwww/hostapd.conf /etc/
brctl addbr br0
hostapd -B -dd /etc/hostapd.conf
brctl addif br0 wlan0
ifconfig br0 ${athip}
else if [ "$aporsta" == "1" ]; then
/sbin/set_wpa_supplicant.sh
cp /www/wpa_supplicant.conf /etc/
wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B -dd
ifconfig wlan0 ${athip}
else if [ "$aporsta" == "2" ]; then
ifconfig mesh down > /dev/null 2>&1
iw dev mesh del > /dev/null 2>&1
iw dev wlan0 interface add mesh type mp mesh_id ${generl_ssid}
ifconfig mesh ${athip} up
iw dev mesh set channel ${generl_channel}
iw dev mesh scan # > /dev/null 2>&1
else if [ "$aporsta" == "3" ]; then
ifconfig adhoc down > /dev/null 2>&1
ifconfig adhoc down > /dev/null 2>&1
iw dev wlan0 interface add adhoc type ibss
iwconfig adhoc essid ${generl_ssid}
ifconfig adhoc ${athip} up
iwconfig adhoc channel ${generl_channel}
iw dev adhoc scan
fi #end adhoc configure
fi #end mesh configure
fi #end station configure
fi #end ap configure