#!/bin/bash # Petr Simandl # zavedení ovladace pro wifi kartu xi626 # a spusteni AP v siti CZFree.Net.yenik.sv # nod yenik smer severovychod #mac is enough to identify the card #mac="00:0E:8E:0C:8C:32" mac="00:0E:8E:0C:8A:E3" ##################################################### #getting mask for ifaces recognition macgr=`echo $mac | tr ":" "." | sed 's/^00/0./'` #getting all actual ifaces by the mask and destroying them for i in `/sbin/ifconfig -a | grep $macgr | grep -v wifi | awk '{print $1}'` do /usr/local/bin/wlanconfig $i destroy done #getting iwace name iwace=`/sbin/ifconfig -a | grep $macgr | grep "^wifi" | awk '{print $1}'` ##################################################### iface="ath2" /usr/local/bin/wlanconfig $iface create wlandev $iwace wlanmode ap > /dev/null /sbin/ifconfig $iface inet 10.33.5.1 netmask 255.255.255.192 broadcast 10.33.5.63 /sbin/iwconfig $iface essid "CZFree.Net.yenik.sv" #/sbin/iwpriv $iface mode 2 #pry to odstrani tuhnuti AP #http://madwifi.org/ticket/581 /sbin/iwpriv ath0 uapsd 0 sleep 1s /sbin/iwconfig $iface channel 1 sleep 1s /usr/local/bin/athctrl -i $iwace -d 10000 sleep 10s /sbin/iwconfig $iface channel 1