SmartAudio/package/allwinner/wifimanager/files/wifi.init

44 lines
991 B
Plaintext
Raw Permalink Normal View History

2018-07-13 01:31:50 +00:00
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org
START=21
STOP=99
USE_PROCD=1
PROG=wpa_supplicant
OOM_ADJ=-17
2018-07-17 07:44:16 +00:00
#CFG_FILE=/etc/wifi/wpa_supplicant.conf
#CFG_FILE_ADD=/etc/wifi/wpa_supplicant_overlay.conf
#CTR_INTERFACE=/etc/wifi/sockets
CFG_FILE=/mnt/UDISK/wifi/wpa_supplicant.conf
CFG_FILE_ADD=/mnt/UDISK/wifi/wpa_supplicant_overlay.conf
CTR_INTERFACE=/mnt/UDISK/wifi/sockets
2018-07-13 01:31:50 +00:00
start_service() {
procd_open_instance
wpa=`ps | grep wpa_supplicant | grep -v grep`
[ -n "$wpa" ] && {
killall wpa_supplicant
sleep 1
}
2018-07-13 01:31:50 +00:00
ifconfig wlan0 up
procd_set_param oom_adj $OOM_ADJ
2018-07-17 07:44:16 +00:00
procd_set_param command $PROG -iwlan0 -Dnl80211 -c$CFG_FILE -I$CFG_FILE_ADD -O$CTR_INTERFACE
2018-07-13 01:31:50 +00:00
procd_close_instance
}
stop_service() {
procd_open_instance
wpa=`ps | grep wpa_supplicant | grep -v grep`
[ -n "$wpa" ] && {
killall wpa_supplicant
sleep 1
}
2018-07-13 01:31:50 +00:00
ifconfig wlan0 down
procd_close_instance
}
restart() {
stop $@
start $@
}