SmartAudio/package/allwinner/wifimanager/wifi.init

35 lines
723 B
Bash
Executable File

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org
START=21
STOP=99
USE_PROCD=1
PROG=wpa_supplicant
OOM_ADJ=-17
start_service() {
procd_open_instance
if ps | grep [w]pa_supplicant ; then
killall -q -KILL wpa_supplicant
sleep 2
fi
ifconfig wlan0 up
procd_set_param oom_adj $OOM_ADJ
procd_set_param command $PROG -iwlan0 -Dnl80211 -c/etc/wifi/wpa_supplicant.conf -I/etc/wifi/wpa_supplicant_overlay.conf -O/etc/wifi/sockets
procd_close_instance
}
stop_service() {
procd_open_instance
if ps | grep [w]pa_supplicant ; then
killall -q -KILL wpa_supplicant
fi
ifconfig wlan0 down
procd_close_instance
}
restart() {
stop $@
start $@
}