}
config_cb() {
- local chilli_inst="$2"
- if [ "$chilli_inst" != "" ]; then
- chilli_conf="/var/run/chilli_${chilli_inst}.conf"
- if [ -e "$chilli_conf" ]; then
- rm -f "$chilli_conf"
- fi
- eval "start_chilli_$chilli_inst=1"
- fi
+ chilli_conf="/var/run/chilli_${2}.conf"
+ [ -e "$chilli_conf" ] && rm -f "$chilli_conf"
}
option_cb() {
case "$1" in
+ # ignored/internal settings
+ disabled)
+ ;;
# UCI settings
network)
. /lib/functions/network.sh
network_get_device ifname "$2"
echo "dhcpif=\"$ifname\"" >> "$chilli_conf"
;;
- disabled)
- [ "$(config_get_bool "$1")" = "1" ] && eval "start_chilli_$chilli_inst=0"
- ;;
# boolean settings
debug|dhcpbroadcast|nodynip|vlanlocation|locationstopstart|locationcopycalled|\
locationimmediateupdate|locationopt82|coanoipcheck|noradallow|proxymacaccept|\
start_chilli() {
local cfg="$1"
- local start_chilli=$(eval "echo \$start_chilli_$cfg")
- [ "$start_chilli" = "0" ] && return
local base="/var/run/chilli_${cfg}"
+ config_get_bool disabled "$1" 'disabled' 1
+ [ $disabled = 1 ] && return
+
procd_open_instance "$cfg"
procd_set_param command /usr/sbin/chilli
- procd_set_param file "${base}.conf"
+ procd_set_param file "$chilli_conf"
procd_append_param command \
--fg \
--conf "${base}.conf" \