diff options
author | Darren 'Tadgy' Austin <darren@afterdark.org.uk> | 2018-07-29 19:44:00 +0100 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2018-11-25 19:26:03 -0600 |
commit | 90b4dca0900c37b95a4fcfb0cff6ef87ff691aa2 (patch) | |
tree | c16df18df02230a35ffec1fc2106d849f1dfe773 | |
parent | ec3714dbcbe262f55be626ac8058c6273d7cea50 (diff) | |
download | slacknetsetup-90b4dca0900c37b95a4fcfb0cff6ef87ff691aa2.tar.xz |
Change DHCP_OPTIONS into an array
Signed-off-by: Robby Workman <rworkman@slackware.com>
-rw-r--r-- | rc.inet1 | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -173,18 +173,19 @@ if_up() { echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf # Clear DHCP_OPTIONS before adding new options to it: unset DHCP_OPTIONS + declare -a DHCP_OPTIONS # Set DHCP_OPTIONS for this interface: - [ -n "${DHCP_HOSTNAME[$i]}" ] && DHCP_OPTIONS="-h ${DHCP_HOSTNAME[$i]}" - [ "${DHCP_KEEPRESOLV[$i]}" = "yes" ] && DHCP_OPTIONS="$DHCP_OPTIONS -C resolv.conf" - [ "${DHCP_KEEPNTP[$i]}" = "yes" ] && DHCP_OPTIONS="$DHCP_OPTIONS -C ntp.conf" - [ "${DHCP_KEEPGW[$i]}" = "yes" ] && DHCP_OPTIONS="$DHCP_OPTIONS -G" - [ "${DHCP_DEBUG[$i]}" = "yes" ] && DHCP_OPTIONS="$DHCP_OPTIONS -d" - [ "${DHCP_NOIPV4LL[$i]}" = "yes" ] && DHCP_OPTIONS="$DHCP_OPTIONS -L" - [ -n "${DHCP_IPADDR[$i]}" ] && DHCP_OPTIONS="$DHCP_OPTIONS -r ${DHCP_IPADDR[$i]}" + [ -n "${DHCP_HOSTNAME[$i]}" ] && DHCP_OPTIONS+=("-h" "${DHCP_HOSTNAME[$i]}") + [ "${DHCP_KEEPRESOLV[$i]}" = "yes" ] && DHCP_OPTIONS+=("-C" "resolv.conf") + [ "${DHCP_KEEPNTP[$i]}" = "yes" ] && DHCP_OPTIONS+=("-C" "ntp.conf") + [ "${DHCP_KEEPGW[$i]}" = "yes" ] && DHCP_OPTIONS+=("-G") + [ "${DHCP_DEBUG[$i]}" = "yes" ] && DHCP_OPTIONS+=("-d") + [ "${DHCP_NOIPV4LL[$i]}" = "yes" ] && DHCP_OPTIONS+=("-L") + [ -n "${DHCP_IPADDR[$i]}" ] && DHCP_OPTIONS+=("-r" "${DHCP_IPADDR[$i]}") echo "Polling for DHCP server on interface ${1}:" # 15 seconds should be a reasonable default DHCP timeout. 30 was too much. - echo "/etc/rc.d/rc.inet1: /sbin/dhcpcd -L -t ${DHCP_TIMEOUT[$i]:-15} ${DHCP_OPTIONS} ${1}" | $LOGGER - /sbin/dhcpcd -L -t ${DHCP_TIMEOUT[$i]:-15} ${DHCP_OPTIONS} ${1} + echo "/etc/rc.d/rc.inet1: /sbin/dhcpcd -L -t ${DHCP_TIMEOUT[$i]:-15} ${DHCP_OPTIONS[@]} ${1}" | $LOGGER + /sbin/dhcpcd -L -t "${DHCP_TIMEOUT[$i]:-15}" "${DHCP_OPTIONS[@]}" ${1} elif [ -n "${IPADDR[$i]}" ] || [ -n "${IPADDR6[$i]}" ]; then # use a fixed IP to bring interface up # Disable v6 IP auto configuration: echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf |