From 3bd816fb3a30e085cfac69d14f61243920472f65 Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Fri, 21 Jul 2017 11:25:28 +0200 Subject: init.d/functions: convert2sec() function added And network-scripts/network-functions was patched to use convert2sec(). This function can be used to convert the value of its first parameter to a number of seconds - based on the time unit (specified as the second parameter). This is mostly useful for converting values for use with the sleep(1). --- sysconfig/network-scripts/network-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysconfig/network-scripts') diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 70896ff1..d7915e31 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -198,7 +198,7 @@ ethtool_set() IFS=';'; if [ -n "${ETHTOOL_DELAY}" ]; then # Convert microseconds to seconds: - local ETHTOOL_DELAY_SEC=$(awk "BEGIN {printf \"%f\", ${ETHTOOL_DELAY} / 1000000}") + local ETHTOOL_DELAY_SEC=$(convert2sec ${ETHTOOL_DELAY} micro) sleep ${ETHTOOL_DELAY_SEC} fi for opts in $ETHTOOL_OPTS ; do -- cgit v1.2.1