summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortorben2018-09-10 22:47:58 +0200
committertorben2018-09-10 22:47:58 +0200
commitdc8dbf6d02199390fb505605aa33c42c125e058c (patch)
treea7b0c5ee27537e146cf28d643a21c39eaadabd5d
parentfix kernel panic. (diff)
downloadsystemd-init-dc8dbf6d02199390fb505605aa33c42c125e058c.tar.gz
systemd-init-dc8dbf6d02199390fb505605aa33c42c125e058c.tar.xz
systemd-init-dc8dbf6d02199390fb505605aa33c42c125e058c.zip
improve network resilience.
-rwxr-xr-xmodules.d/systemd-networkd-ext/hooks/wait-for-network.sh25
1 files changed, 14 insertions, 11 deletions
diff --git a/modules.d/systemd-networkd-ext/hooks/wait-for-network.sh b/modules.d/systemd-networkd-ext/hooks/wait-for-network.sh
index 6237d17d..f36a91dd 100755
--- a/modules.d/systemd-networkd-ext/hooks/wait-for-network.sh
+++ b/modules.d/systemd-networkd-ext/hooks/wait-for-network.sh
@@ -53,20 +53,23 @@ if (( ${#network_interface_names[@]} > 0 )); then
done
# NOTE: Fixes an ugly race condition bug bug with the "dwa-131 E1" usb
# wireless device.
- if \
- ! $online && \
- ip a | grep wireless &>/dev/null && \
- modprobe --remove rtl8xxxu &>/dev/null
- then
- modprobe rtl8xxxu
+ declare -i round=0
+ for round in 1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 21 22 23; do
if \
- /lib/systemd/systemd-networkd-wait-online \
- --interface wireless \
- --timeout 20
+ ! $online && \
+ ip a | grep wireless &>/dev/null && \
+ modprobe --remove rtl8xxxu &>/dev/null
then
- online=true
+ modprobe rtl8xxxu
+ if \
+ /lib/systemd/systemd-networkd-wait-online \
+ --interface wireless \
+ --timeout 20
+ then
+ online=true
+ fi
fi
- fi
+ done
if ! $online; then
if [ -f /mnt/slx_writable_device/openslx ]; then
warn No network connection available: Starting in offline mode.