44 lines
991 B
Bash
Executable File
44 lines
991 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
|
|
#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
|
|
|
|
start_service() {
|
|
procd_open_instance
|
|
wpa=`ps | grep wpa_supplicant | grep -v grep`
|
|
[ -n "$wpa" ] && {
|
|
killall wpa_supplicant
|
|
sleep 1
|
|
}
|
|
ifconfig wlan0 up
|
|
procd_set_param oom_adj $OOM_ADJ
|
|
procd_set_param command $PROG -iwlan0 -Dnl80211 -c$CFG_FILE -I$CFG_FILE_ADD -O$CTR_INTERFACE
|
|
procd_close_instance
|
|
}
|
|
|
|
stop_service() {
|
|
procd_open_instance
|
|
wpa=`ps | grep wpa_supplicant | grep -v grep`
|
|
[ -n "$wpa" ] && {
|
|
killall wpa_supplicant
|
|
sleep 1
|
|
}
|
|
ifconfig wlan0 down
|
|
procd_close_instance
|
|
}
|
|
restart() {
|
|
stop $@
|
|
start $@
|
|
}
|