From b10d2b229c37451b8c7462da01521290183b8325 Mon Sep 17 00:00:00 2001 From: ars Date: Wed, 21 Oct 2020 22:46:20 +0100 Subject: Make config reading much simpler (far too overengineered before). --- oedquery.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/oedquery.sh b/oedquery.sh index a255839..239d2cf 100755 --- a/oedquery.sh +++ b/oedquery.sh @@ -12,15 +12,7 @@ config=( # curl options OPTS='--silent -L -H "app_id: $appId" -H "app_key: $appKey"' -while read line -do - # If config file variable doesn't match variable in config array then ignore it. - if [[ " ${config[@]} " =~ " $(echo "$line" | cut -d '=' -f 1) " ]] - then - # Declare variables - eval $(echo "$line" | cut -d '=' -f 1)=$(echo "$line" | cut -d '=' -f 2-) -fi -done < oedquery.conf +source oedquery.conf # function to provide data to a for loop _jq() { -- cgit v1.2.3