From e5d95235f235c685986706224d759219a84601c7 Mon Sep 17 00:00:00 2001 From: hanzongcheng Date: Tue, 2 Nov 2021 00:16:46 +0800 Subject: network scripts: replace "<<<" with pipe Busybox's shell does not support "<<<", fix it by using pipe. Signed-off-by: hanzongcheng --- network-scripts/ifup-eth | 4 ++-- network-scripts/network-functions | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/network-scripts/ifup-eth b/network-scripts/ifup-eth index 04861e56..de6af876 100755 --- a/network-scripts/ifup-eth +++ b/network-scripts/ifup-eth @@ -100,11 +100,11 @@ if [ "${TYPE}" = "Bridge" ]; then forward_delay="$(convert2sec ${forward_delay} centi)" fi - forward_delay=$(bc -q <<< "${forward_delay} * 2 + 7") + forward_delay=$(echo "${forward_delay} * 2 + 7" | bc -q) # It's possible we are comparing floating point numbers here, therefore # we are using 'bc' for comparison. The [ ] and [[ ]] do not work. - (( $(bc -l <<< "${LINKDELAY:-0} < ${forward_delay}") )) && LINKDELAY=${forward_delay} + (( $(echo "${LINKDELAY:-0} < ${forward_delay}" | bc -l) )) && LINKDELAY=${forward_delay} unset forward_delay fi diff --git a/network-scripts/network-functions b/network-scripts/network-functions index b2ef99e1..c7d9e60e 100644 --- a/network-scripts/network-functions +++ b/network-scripts/network-functions @@ -163,10 +163,10 @@ source_config () ;; esac if [ -n "$HWADDR" ]; then - HWADDR=$(tr '[a-z]' '[A-Z]' <<<"$HWADDR") + HWADDR=$(echo "$HWADDR" | tr '[a-z]' '[A-Z]') fi if [ -n "$MACADDR" ]; then - MACADDR=$(tr '[a-z]' '[A-Z]' <<<"$MACADDR") + MACADDR=$(echo "$MACADDR" | tr '[a-z]' '[A-Z]') fi [ -z "$DEVICE" -a -n "$HWADDR" ] && DEVICE=$(get_device_by_hwaddr $HWADDR) [ -z "$DEVICETYPE" ] && DEVICETYPE=$(echo ${DEVICE} | sed "s/[0-9]*$//") -- cgit v1.2.1