#!/bin/sh # Restart the network at the end of the boot process # so /etc/network/interfaces is effective for wlan0 date /etc/init.d/networking restart date # Kick statistics gatherer #/etc/init.d/ntop restart # Authorize all MAC addresses in /etc/hosts # by adding them to the Access Control List # For iwpriv documentation see the README at http://hostap.epitest.fi /sbin/iwpriv wlan0 maccmd 3 # Flush the ACL (filter out all MACs) /sbin/iwpriv wlan0 maccmd 1 # Add the following MAC addresses to the ACL # Put all MAC addresses from the hosts file into a variable macs=$(grep "00:" /etc/hosts | cut --bytes=31-47) echo "Authorizing these MAC addresses..." for mac in $macs do echo $mac /sbin/iwpriv wlan0 addmac $mac done exit