include fixes from #2429 Thanks Lubos Stanek

SVN-Revision: 9028
owl
Travis Kemen 2007-09-25 23:16:31 +00:00
parent 000b777b73
commit 112c359dad
1 changed files with 53 additions and 53 deletions

View File

@ -21,9 +21,19 @@ append_bool() {
local section="$1" local section="$1"
local option="$2" local option="$2"
local value="$3" local value="$3"
local _tmp local _loctmp
config_get_bool _tmp "$section" "$option" config_get_bool _loctmp "$section" "$option"
[ "$_tmp" -gt 0 ] && append args "$3" [ "$_loctmp" -gt 0 ] && append args "$3"
}
append_parm() {
local section="$1"
local option="$2"
local switch="$3"
local _loctmp
config_get _loctmp "$section" "$option"
[ -z "$_loctmp" ] && return 0
append args "$switch $_loctmp"
} }
dnsmasq() { dnsmasq() {
@ -41,21 +51,10 @@ dnsmasq() {
append_bool "$cfg" readethers "-Z" append_bool "$cfg" readethers "-Z"
append_bool "$cfg" dbus "-l" append_bool "$cfg" dbus "-l"
config_get dnsforwardmax "$cfg" dnsforwardmax append_parm "$cfg" dnsforwardmax "-0"
dnsforwardmax="${dnsforwardmax:-150}" append_parm "$cfg" port "-p"
append args "-0 $dnsforwardmax" append_parm "$cfg" ednspacket_max "-P"
append_parm "$cfg" dhcpleasemax "-X"
config_get port "$cfg" port
port="${port:-53}"
append args "-p $port"
config_get ednspacket_max "$cfg" ednspacket_max
ednspacket_max="${ednspacket_max:-1280}"
append args "-P $ednspacket_max"
config_get dhcpleasemax "$cfg" dhcpleasemax
dhcpleasemax="${dhcpleasemax:-150}"
append args "-X $dhcpleasemax"
config_get addnhosts "$cfg" addnhosts config_get addnhosts "$cfg" addnhosts
config_get interface "$cfg" interface config_get interface "$cfg" interface
@ -207,7 +206,7 @@ dhcp_add() {
dhcp_option_add "$cfg" "$name" dhcp_option_add "$cfg" "$name"
} }
dhcp_option_add () { dhcp_option_add() {
local cfg="$1" local cfg="$1"
local name="$2" local name="$2"
@ -225,6 +224,7 @@ dhcp_option_add () {
start() { start() {
include /lib/network include /lib/network
scan_interfaces scan_interfaces
config_load /var/state/network
config_load dhcp config_load dhcp
args="" args=""