isc-dhcp: Use 'append' instead of manually appending
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
This commit is contained in:
parent
a6d6475cd5
commit
96e720bb6b
2 changed files with 10 additions and 10 deletions
|
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||||
PKG_NAME:=isc-dhcp
|
PKG_NAME:=isc-dhcp
|
||||||
UPSTREAM_NAME:=dhcp
|
UPSTREAM_NAME:=dhcp
|
||||||
PKG_VERSION:=4.4.3-P1
|
PKG_VERSION:=4.4.3-P1
|
||||||
PKG_RELEASE:=6
|
PKG_RELEASE:=7
|
||||||
|
|
||||||
PKG_LICENSE:=BSD-3-Clause
|
PKG_LICENSE:=BSD-3-Clause
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
|
|
@ -151,7 +151,7 @@ append_routes() {
|
||||||
octets=$((($prefix + 7) / 8))
|
octets=$((($prefix + 7) / 8))
|
||||||
compacted="$(echo "$network" | cut -d. -f1-$octets)"
|
compacted="$(echo "$network" | cut -d. -f1-$octets)"
|
||||||
|
|
||||||
routes="$routes${routes:+, }$(explode "$prefix${compacted:+.$compacted}.$router")"
|
append routes "$(explode "$prefix${compacted:+.$compacted}.$router")" ", "
|
||||||
}
|
}
|
||||||
|
|
||||||
append_dhcp_options() {
|
append_dhcp_options() {
|
||||||
|
@ -174,7 +174,7 @@ append_dhcp_options() {
|
||||||
value="\"$value\""
|
value="\"$value\""
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
formatted="$formatted${formatted:+, }$value"
|
append formatted "$value" ", "
|
||||||
done
|
done
|
||||||
echo " option $tag $formatted;"
|
echo " option $tag $formatted;"
|
||||||
}
|
}
|
||||||
|
@ -294,17 +294,17 @@ static_host_add() {
|
||||||
for option in $force_send; do
|
for option in $force_send; do
|
||||||
case "$option" in
|
case "$option" in
|
||||||
hostname)
|
hostname)
|
||||||
extra_options="$extra_options${extra_options:+,}0c" ;;
|
append extra_options "0c" "," ;;
|
||||||
domain-name)
|
domain-name)
|
||||||
extra_options="$extra_options${extra_options:+,}0f" ;;
|
append extra_options "0f" "," ;;
|
||||||
renewal-time)
|
renewal-time)
|
||||||
extra_options="$extra_options${extra_options:+,}3a" ;;
|
append extra_options "3a" "," ;;
|
||||||
rebinding-time)
|
rebinding-time)
|
||||||
extra_options="$extra_options${extra_options:+,}3b" ;;
|
append extra_options "3b" "," ;;
|
||||||
fqdn)
|
fqdn)
|
||||||
extra_options="$extra_options${extra_options:+,}51" ;;
|
append extra_options "51" "," ;;
|
||||||
routes)
|
routes)
|
||||||
extra_options="$extra_options${extra_options:+,}79" ;;
|
append extra_options "79" "," ;;
|
||||||
*)
|
*)
|
||||||
echo "unknown option: $option" >&2 ;;
|
echo "unknown option: $option" >&2 ;;
|
||||||
esac
|
esac
|
||||||
|
@ -435,7 +435,7 @@ dhcpd_add() {
|
||||||
|
|
||||||
local octets="$(rfc1918_prefix "$subnet")"
|
local octets="$(rfc1918_prefix "$subnet")"
|
||||||
|
|
||||||
[ -n "$octets" ] && rfc1918_nets="$rfc1918_nets${rfc1918_nets:+ }$octets"
|
[ -n "$octets" ] && append rfc1918_nets "$octets"
|
||||||
|
|
||||||
[ $synthesize -eq 0 ] && return
|
[ $synthesize -eq 0 ] && return
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue