From 7a91d90a7cb78f39eabb17a36332e2aabdb7a2c2 Mon Sep 17 00:00:00 2001 From: Satu Koskinen Date: Sat, 22 Oct 2022 15:56:41 +0300 Subject: [PATCH] Add option to pass CONFIG_FILE as parameter to export-config-values.sh --- scripts/export-config-values.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/export-config-values.sh b/scripts/export-config-values.sh index 9b7b58a..29ec5a0 100644 --- a/scripts/export-config-values.sh +++ b/scripts/export-config-values.sh @@ -1,5 +1,9 @@ #!/bin/bash -CONFIG_FILE=/boot/hydrophonitor/configuration/hydrophonitor-config.txt +if [ $# -eq 1 ]; then + CONFIG_FILE=$1 +else + CONFIG_FILE=/boot/hydrophonitor/hydrophonitor-config.txt +fi export $(grep -v '^#' $CONFIG_FILE | tr -d '[:space:]' | xargs -d '\n')