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.
 
 
 
 
 
 

49 lines
884 B

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