#!/bin/bash ### BEGIN INIT INFO # Provides: wifi # Required-Start: $network $remote_fs $syslog # Required-Stop: $network $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: Load MediaTek MT6625L firmware ### END INIT INFO # Don't exit on error status set +e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/dev/null NAME=wifi DESC="Load MediaTek MT6625L firmware wifi & BT" if [[ ! -e /dev/wmtWifi ]]; then echo "wifidev does not exist...create it..." # Check FILE exists and is executable if [[ -x /usr/bin/wmt_loader ]]; then # ?? /usr/bin/wmt_loader sleep 3 else echo "Error, unable to find wmt_loader" fi # Check FILE exists and is character special if [[ -c /dev/stpwmt ]]; then # Load firmware /usr/bin/stp_uart_launcher -p /etc/firmware & sleep 5 else echo "Error, device no created, /dev/stpwmt" fi fi # Check FILE exists and is character special if [[ -c /dev/wmtWifi ]]; then if [[ -n $(ip a|grep ap0) ]]; then echo "ap0 exists, reset it"; echo 0 >/dev/wmtWifi sleep 5 fi echo A >/dev/wmtWifi sleep 2 else echo "Error, wifi device no created, /dev/wmtWifi" fi # Check NIC ap0 #ifconfig ap0 ip addr show ap0 if [[ $? != "0" ]] then echo "Error, device no available, ap0" else echo "Done, all good, ready to lauch hostapd" #hostapd -dd /etc/hostapd/hostapd_ap0.conf #ip addr add 192.168.10.1/24 dev ap0 #service dnsmasq restart fi