Fix setting and exporting configuration values
This commit is contained in:
parent
48158a6d4d
commit
41b0f7470c
@ -6,4 +6,10 @@ else
|
||||
CONFIG_FILE=/boot/hydrophonitor/hydrophonitor-config.txt
|
||||
fi
|
||||
|
||||
export $(grep -v '^#' $CONFIG_FILE | tr -d '[:space:]' | xargs -d '\n')
|
||||
# Select non-comment lines in CONFIG_FILE, clean horizontal whitespace
|
||||
args=$(grep -v '^#' $CONFIG_FILE | tr -d '[:blank:]' | tr '\n' ' ')
|
||||
|
||||
for arg in $args; do
|
||||
echo "export $arg"
|
||||
export "${arg?}"
|
||||
done
|
||||
|
@ -10,7 +10,7 @@ echo "### Update file paths in config and start script files"
|
||||
echo
|
||||
|
||||
# Update hydrophonitor-config.txt HOME_PATH to the current user's home
|
||||
sudo sed -i "s|^HOME_PATH=.*$|HOME_PATH=$HOME|" $BOOT_DIR_PATH/hydrophonitor_config.txt
|
||||
sudo sed -i "s|^HOME_PATH=.*$|HOME_PATH=$HOME|" $BOOT_DIR_PATH/hydrophonitor-config.txt
|
||||
|
||||
# Update script path in start scripts to the current user's home
|
||||
sudo sed -i "s|^SCRIPT_PATH=.*$|SCRIPT_PATH=$HOME/hydrophonitor/scripts|" $BOOT_DIR_PATH/scripts/start-all.sh
|
||||
|
@ -6,7 +6,7 @@ set -x
|
||||
SCRIPT_PATH=/home/pi/hydrophonitor/scripts
|
||||
|
||||
# Export the configuration values
|
||||
$SCRIPT_PATH/export-config-values.sh
|
||||
. $SCRIPT_PATH/export-config-values.sh
|
||||
|
||||
# Create output directory
|
||||
OUTPUT_DIR=$OUTPUT_PATH/$(date +"%Y-%m-%d_%H-%M-%S_output")
|
||||
|
@ -4,7 +4,7 @@ set -x
|
||||
|
||||
# Export the configuration values
|
||||
SCRIPT_PATH=/home/pi/hydrophonitor/scripts
|
||||
$SCRIPT_PATH/export-config-values.sh
|
||||
. $SCRIPT_PATH/export-config-values.sh
|
||||
|
||||
AUDIO_TARGET_EXECUTABLE="audio"
|
||||
|
||||
|
@ -4,7 +4,7 @@ set -x
|
||||
|
||||
# Export the configuration values
|
||||
SCRIPT_PATH=/home/pi/hydrophonitor/scripts
|
||||
$SCRIPT_PATH/export-config-values.sh
|
||||
. $SCRIPT_PATH/export-config-values.sh
|
||||
|
||||
OPTIONS="--output $OUTPUT_DIR --interval $GPS_INTERVAL"
|
||||
|
||||
|
@ -4,7 +4,7 @@ set -x
|
||||
|
||||
# Export the configuration values
|
||||
SCRIPT_PATH=/home/pi/hydrophonitor/scripts
|
||||
$SCRIPT_PATH/export-config-values.sh
|
||||
. $SCRIPT_PATH/export-config-values.sh
|
||||
|
||||
OPTIONS="--output $OUTPUT_DIR --interval $DEPTH_INTERVAL"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user