aboutsummaryrefslogtreecommitdiff
path: root/net.Linux/tuntap.sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-30 15:57:01 +0000
committerRoy Marples <roy@marples.name>2008-01-30 15:57:01 +0000
commitee44b907957f02f2d5b5f25da663ee90df6c41b3 (patch)
tree37db5c2f03debd762f56af32f60673c38b5b2dee /net.Linux/tuntap.sh
parent84ad9a40a647b97551bc8bc35f082bd82e8b8c92 (diff)
Add a timeout for creating tun/tap interfaces.
Diffstat (limited to 'net.Linux/tuntap.sh')
-rw-r--r--net.Linux/tuntap.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/net.Linux/tuntap.sh b/net.Linux/tuntap.sh
index 62008135..bd494db5 100644
--- a/net.Linux/tuntap.sh
+++ b/net.Linux/tuntap.sh
@@ -25,6 +25,18 @@ tuntap_pre_start()
eerror "TUN/TAP support is not present in this kernel"
return 1
fi
+ vebegin "Waiting for /dev/net/tun"
+ # /dev/net/tun can take it's time to appear
+ local timeout=10
+ while [ ! -e /dev/net/tun -a ${timeout} -gt 0 ]; do
+ sleep 1
+ timeout=$((${timeout} - 1))
+ done
+ if [ ! -e /dev/net/tun ]; then
+ eerror "TUN/TAP support present but /dev/net/tun is not"
+ return 1
+ fi
+ veend 0
fi
ebegin "Creating Tun/Tap interface ${IFACE}"