logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

get_network.sh (419B)


  1. #!/bin/sh
  2. #
  3. # SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
  4. #
  5. # SPDX-License-Identifier: GPL-3.0-or-later
  6. #
  7. dhcpcd --waitip=4
  8. # Ensure network accessible
  9. timeout=120
  10. while ! curl example.com >/dev/null 2>&1; do
  11. sleep 1
  12. # shellcheck disable=SC2219
  13. let timeout--
  14. if [ "${timeout}" -le 0 ]; then
  15. echo "Timeout reached for internet to become accessible"
  16. false
  17. fi
  18. done