Skip to content

Commit

Permalink
speed up container startup
Browse files Browse the repository at this point in the history
piaware-config is pretty slow, just use a function to replace it as it
only writes to /etc/piaware.conf anyhow
  • Loading branch information
wiedehopf committed Apr 14, 2024
1 parent 19feb60 commit 36ea3e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rootfs/etc/s6-overlay/scripts/01-piaware
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
rm /etc/piaware.conf > /dev/null 2>&1 || true
touch /etc/piaware.conf

# piaware-config is very slow, as we have full control over the config file, just use a function to directly write the config settings into the config file
function piaware-config() {
echo "$1 \"$2\"" | tee -a /etc/piaware.conf
}

# Check to make sure the correct command line arguments have been set
EXITCODE=0
if [[ -n "${USERNAME}" ]]; then
Expand Down Expand Up @@ -76,7 +81,7 @@ fi

# If MLAT_RESULTS_BEAST_CONNECT is specified
if [[ -n "$MLAT_RESULTS_BEASTHOST" ]]; then
piaware-config mlat-results-format "$(piaware-config -show mlat-results-format) beast,connect,${MLAT_RESULTS_BEASTHOST}:${MLAT_RESULTS_BEASTPORT:-30104}"
piaware-config mlat-results-format "beast,connect,localhost:30104 beast,listen,30105 ext_basestation,listen,30106 beast,connect,${MLAT_RESULTS_BEASTHOST}:${MLAT_RESULTS_BEASTPORT:-30104}"
fi

# Create log dir for piaware
Expand Down

0 comments on commit 36ea3e5

Please sign in to comment.