aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/network-functions
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/network-functions')
-rw-r--r--sysconfig/network-scripts/network-functions17
1 files changed, 17 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 3b8d79d4..b9b35c0f 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -330,6 +330,23 @@ END {
[ -d "/sys/class/net/$1" ] && return 0 || return 1
}
+is_available_wait ()
+{
+ [ -z "$1" ] && return 1
+
+ local retry=${2##*[!0-9]*}
+
+ is_available $1 && return 0
+
+ while [ 0"$retry" -gt 0 ]; do
+ sleep 1
+ [ -d "/sys/class/net/$1" ] && return 0
+ retry=$(($retry -1))
+ done
+
+ return 1
+}
+
need_hostname ()
{
CHECK_HOSTNAME=$(hostname)