From 36ea3e5f6e7908fe6ece0896cf2cb5487024a13d Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Sun, 14 Apr 2024 04:41:22 +0200 Subject: [PATCH] speed up container startup piaware-config is pretty slow, just use a function to replace it as it only writes to /etc/piaware.conf anyhow --- rootfs/etc/s6-overlay/scripts/01-piaware | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rootfs/etc/s6-overlay/scripts/01-piaware b/rootfs/etc/s6-overlay/scripts/01-piaware index f96995f..ddcad2e 100755 --- a/rootfs/etc/s6-overlay/scripts/01-piaware +++ b/rootfs/etc/s6-overlay/scripts/01-piaware @@ -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 @@ -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