You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 lines
675 B

#!/bin/sh /etc/rc.common
USE_PROCD=1
START=95
BIN=/usr/bin/wifidog-ng
parse_whitelist() {
local cfg="$1"
local domain mac
uci_validate_section wifidog-ng whitelist "${1}" \
'domain:list(host)' \
'mac:list(macaddr)'
[ $? -ne 0 ] && {
echo "validation failed" >&2
exit 1
}
for m in $mac; do
echo "!$m" > /proc/wifidog-ng/term
done
}
start_service() {
modprobe wifidog-ng
config_load wifidog-ng
config_foreach parse_whitelist whitelist
procd_open_instance
procd_set_param command $BIN
procd_set_param respawn
procd_close_instance
}
stop_service() {
rmmod wifidog-ng
}