linux wifi热点启动脚本

linux wifi热点启动脚本

 

最近有关wifi热点的驱动,启动参数都调试完了,验证可以连接传输数据。

首先要在系统启动脚本中插入wifi驱动,配置wlan0的ip

insmod /system/vendor/modules/8188eu.ko
ifconfig wlan0 192.168.201.1  netmask 255.255.255.0
/etc/softat-server start &

 

今天就把wifi ap的start stop脚本给弄了一下。

#!/bin/sh
#

# It is not safe to start if we don‘t have a default configuration...
#echo "/etc/init.d/dhcp-server not yet configured! - Aborting..."
#exit 1;

test -f /usr/sbin/hostapd || exit 0
test -f /etc/hostapd.conf || exit 0
test -f /usr/sbin/dhcpd || exit 0
test -f /etc/dhcpd.conf || exit 0

case "$1" in
        start)
                echo -n "Starting SoftAp server: "
                test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
                test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases
                start-stop-daemon -S -x /usr/sbin/hostapd /etc/hostapd.conf -b
                start-stop-daemon -S -x /usr/sbin/dhcpd
                ;;
        stop)
                echo -n "Stopping SoftAp server"
                start-stop-daemon -K -x /usr/sbin/dhcpd
                start-stop-daemon -K -x /usr/sbin/hostapd
                ;;
        restart | force-reload)
                $0 stop
                sleep 2
                $0 start
                if [ "$?" != "0" ]; then
                        exit 1
                fi
                ;;
        *)
                echo "Usage: /etc/softp-server {start|stop|restart|force-reload}"
                exit 1
esac

exit 0
~                   

经过测试以上脚本可用。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值