Merge pull request #28 from basvandewiel/22-coding-style-cleanup

Loop the IP check back into the script's main logic.
This commit is contained in:
Bas v.d. Wiel 2023-03-10 11:56:38 +01:00 committed by GitHub
commit 36dd9860a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -92,9 +92,10 @@ function load_ini() {
function has_ip_address() {
ip addr show | grep 'inet ' | grep -vE '127.|169.254.' >/dev/null 2>&1
if [[ $? -eq 0 ]]; then
echo "true"
return 0
else
echo "false"
echo "Network connectivity is probably not OK. Exiting."
exit 1
fi
}
@ -275,9 +276,12 @@ run_once
# Load configuration from the .ini file if we have one.
load_ini
# Only cause changes if the configuration is viable.
# Only cause changes if the configuration is viable..
viable_config
# ..and our network seems to be working.
has_ip_address
# We wake up the NFS-server if needed
wake_up_nfs