diff options
author | Darren 'Tadgy' Austin <darren@afterdark.org.uk> | 2020-12-01 11:27:28 +0000 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2021-02-27 23:47:58 -0600 |
commit | eba308966b7266ef55f12810cf52433bce7651c4 (patch) | |
tree | 3a14d1712e4cdef9fac63ce1adf17fd5a1427ef8 /rc.inet1 | |
parent | a7e23ae08a4ed8f20266a898d3259470be5dfc2c (diff) | |
download | slacknetsetup-eba308966b7266ef55f12810cf52433bce7651c4.tar.xz |
Use extglobs to protect expansion of IFOPTS. Note: bash + extglob is now required.
Diffstat (limited to 'rc.inet1')
-rw-r--r-- | rc.inet1 | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -159,7 +159,7 @@ br_open() { debug_log "/sbin/ip link set dev ${IFNAME[$1]} type bridge $IFOPT" /sbin/ip link set dev ${IFNAME[$1]} type bridge $IFOPT fi - done <<<"${IFOPTS[$i]}|" # The | on the end is required. + done <<<"${IFOPTS[$i]/%|*([[:blank:]])}|" # The | on the end is required. debug_log "/sbin/ip link set dev ${IFNAME[$1]} up" /sbin/ip link set dev ${IFNAME[$1]} up } @@ -206,7 +206,7 @@ bond_create() { debug_log "/sbin/ip link set dev ${IFNAME[$1]} type bond $IFOPT" /sbin/ip link set dev ${IFNAME[$1]} type bond $IFOPT fi - done <<<"${IFOPTS[$1]}|" # The | on the end is required. + done <<<"${IFOPTS[$1]/%|*([[:blank:]])}|" # The | on the end is required. } # Function to destroy a bond. @@ -288,7 +288,7 @@ if_up() { debug_log "/sbin/ip link set dev ${1} type vlan $IFOPT" /sbin/ip link set dev ${1} type vlan $IFOPT fi - done <<<"${IFOPTS[$i]}|" # The | on the end is required. + done <<<"${IFOPTS[$i]/%|*([[:blank:]])}|" # The | on the end is required. elif [ -z "${BONDNICS[$i]}" ] && [ -z "${BRNICS[$i]}" ]; then # Only apply IFOPTS for a physical interface if it's not been handled # by a higher level interface. @@ -297,7 +297,7 @@ if_up() { debug_log "/sbin/ip link set dev ${1} $IFOPT" /sbin/ip link set dev ${1} $IFOPT fi - done <<<"${IFOPTS[$i]}|" # The | on the end is required. + done <<<"${IFOPTS[$i]/%|*([[:blank:]])}|" # The | on the end is required. fi # Set hardware address: if [ -n "${HWADDR[$i]}" ]; then @@ -637,6 +637,9 @@ stop() { ### MAIN ### ############ +# extglob is required for some functionallity. +shopt -s extglob + case "${1}" in start|up) # "start" (or "up") brings up all configured interfaces: start |