From c17868b51d9a5bf34bc90bbd690e1e44e3753efb Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Sat, 12 Aug 2023 10:37:43 -0400 Subject: [PATCH] Detected corrupt/missing conf file where possible... #56 - Should help prevent this going forward... --- universal/functions.bash | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/universal/functions.bash b/universal/functions.bash index 88329ab..620b05b 100644 --- a/universal/functions.bash +++ b/universal/functions.bash @@ -52,3 +52,19 @@ verifyApiAccess () { fi done } + +ConfValidationCheck () { + logfileSetup + if [ ! -f "/config/extended.conf" ]; then + log "ERROR :: \"extended.conf\" file is missing..." + log "ERROR :: Download the extended.conf config file and place it into \"/config\" folder..." + log "ERROR :: Exiting..." + exit + fi + if [ -z "$enableAutoConfig" ]; then + log "ERROR :: \"extended.conf\" file is unreadable..." + log "ERROR :: Likely caused by editing with a non unix/linux compatible editor, to fix, replace the file with a valid one or correct the line endings..." + log "ERROR :: Exiting..." + exit + fi +}