1#!/bin/sh 2 3cnt=`ps aux | grep wpa_supplicant | grep -v grep | wc -l` 4if [ "${cnt}" != "0" ];then 5 killall wpa_supplicant > /dev/null 6fi 7 8cnt1=`ps aux | grep hostapd | grep -v grep | wc -l` 9if [ "${cnt1}" != "0" ];then 10 killall hostapd > /dev/null 11fi 12 13/etc/init.d/S80dnsmasq stop 14 15echo 1 > /proc/sys/net/ipv4/ip_forward 16iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 17 18sleep 1 19ifconfig mlan0 up 20ifconfig uap0 up 21ifconfig uap0 192.168.2.1 22 23hostapd /etc/hostapd-2.4g.conf & 24#hostapd /etc/hostapd-5g.conf & 25/etc/init.d/S80dnsmasq start 26 27