Add option to pass CONFIG_FILE as parameter to export-config-values.sh

This commit is contained in:
Satu Koskinen 2022-10-22 15:56:41 +03:00
parent 357b227968
commit 7a91d90a7c

View File

@ -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')