From 67b95426d88b284b0b28738258943d66d0a0f798 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Thu, 9 Mar 2023 09:08:33 -0500 Subject: [PATCH] Basic network connectivity check --- functions.sh | 13 +++++++++++++ global.sh | 1 + 2 files changed, 14 insertions(+) diff --git a/functions.sh b/functions.sh index 8430d21d..9f1634d0 100644 --- a/functions.sh +++ b/functions.sh @@ -557,6 +557,19 @@ do done < $1 } +check_network_connectivity() { + # This function will do a basic check for network availability and return "true" if it is working. + # USAGE: if [[ check_network_connectivity == "true" ]]; then + + wget -q --spider $rd_repo + + if [ $? -eq 0 ]; then + echo "true" + else + echo "false" + fi +} + update_rd_conf() { # This function will import a default retrodeck.cfg file and update it with any current settings. This will allow us to expand the file over time while retaining current user settings. # USAGE: update_rd_conf diff --git a/global.sh b/global.sh index 5351a3fa..d1319e4f 100755 --- a/global.sh +++ b/global.sh @@ -14,6 +14,7 @@ bios_checklist="/var/config/retrodeck/tools/bios_checklist.cfg" # A config file lockfile="/var/config/retrodeck/.lock" # where the lockfile is located default_sd="/run/media/mmcblk0p1" # Steam Deck SD default path hard_version="$(cat '/app/retrodeck/version')" # hardcoded version (in the readonly filesystem) +rd_repo="https://github.com/XargonWan/RetroDECK" # The official GitHub repo of RetroDECK # Config files for emulators with single config files