diff options
Diffstat (limited to 'satellit_installer/static_files/system-updates/usr/local/sbin/slx-wait-online')
-rwxr-xr-x | satellit_installer/static_files/system-updates/usr/local/sbin/slx-wait-online | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/satellit_installer/static_files/system-updates/usr/local/sbin/slx-wait-online b/satellit_installer/static_files/system-updates/usr/local/sbin/slx-wait-online new file mode 100755 index 0000000..f4b41dc --- /dev/null +++ b/satellit_installer/static_files/system-updates/usr/local/sbin/slx-wait-online @@ -0,0 +1,15 @@ +#!/bin/bash + +for i in 1 1 2 2 3 1; do + < <(ip route show default) read -r _ _ ip _ + if [ -n "$ip" ]; then + echo "Trying to ping $ip" + ping -W 2 -c 1 "$ip" &> /dev/null && exit 0 + else + echo "No default gateway yet..." + fi + sleep "$i" +done + +exit 1 + |