From b665ce47e07db7549226346cf48a183302d10244 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Thu, 31 Oct 2024 10:14:29 +0100 Subject: [PATCH 1/4] inofity-debug: remove log file before startup --- inotify-debug.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/inotify-debug.sh b/inotify-debug.sh index a6a45c2..601d16e 100755 --- a/inotify-debug.sh +++ b/inotify-debug.sh @@ -15,6 +15,7 @@ if ! command -v inotifywait || ! command -v s6wrap; then fi pkill inotifywait || true +rm -f /run/inotify.log echo 192000 > /proc/sys/fs/inotify/max_user_watches s6wrap --timestamps --args inotifywait -r -m /etc /opt /root /home /usr /lib /boot /var \ From 4dc3f9821d5ec31ad57dd3d082334dcb1e1e5d5b Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Sat, 2 Nov 2024 01:33:21 +0100 Subject: [PATCH 2/4] readsb-gain: auto now a valid setting --- readsb-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readsb-install.sh b/readsb-install.sh index 072e3ce..61c1abe 100755 --- a/readsb-install.sh +++ b/readsb-install.sh @@ -226,7 +226,7 @@ systemctl restart readsb || true mkdir -p /usr/local/bin cat >/usr/local/bin/readsb-gain <<"EOF" #!/bin/bash -validre='^(-10|[0-9]+([.][0-9]+)?)$' +validre='^(auto|-10|[0-9]+([.][0-9]+)?)$' gain=$(echo $1 | tr -cd '[:digit:].-') if ! [[ $gain =~ $validre ]] ; then echo "Error, invalid gain!"; exit 1; fi if ! grep gain /etc/default/readsb &>/dev/null; then sudo sed -i -e 's/RECEIVER_OPTIONS="/RECEIVER_OPTIONS="--gain 49.6 /' /etc/default/readsb; fi From e8ce2c5b4e9c8e5ed18a853e6a5e4f498fbbe7e3 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Sun, 3 Nov 2024 17:43:36 +0100 Subject: [PATCH 3/4] fixup readsb-gain --- readsb-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readsb-install.sh b/readsb-install.sh index 61c1abe..89cbe5b 100755 --- a/readsb-install.sh +++ b/readsb-install.sh @@ -226,11 +226,11 @@ systemctl restart readsb || true mkdir -p /usr/local/bin cat >/usr/local/bin/readsb-gain <<"EOF" #!/bin/bash -validre='^(auto|-10|[0-9]+([.][0-9]+)?)$' -gain=$(echo $1 | tr -cd '[:digit:].-') +validre='^([^ ]*)$' +gain="$1" if ! [[ $gain =~ $validre ]] ; then echo "Error, invalid gain!"; exit 1; fi if ! grep gain /etc/default/readsb &>/dev/null; then sudo sed -i -e 's/RECEIVER_OPTIONS="/RECEIVER_OPTIONS="--gain 49.6 /' /etc/default/readsb; fi -sudo sed -i -E -e "s/--gain .?[0-9]*.?[0-9]* /--gain $gain /" /etc/default/readsb +sudo sed -i -E -e "s/--gain[ =][^ \"]*/--gain $gain/" /etc/default/readsb sudo systemctl restart readsb EOF chmod a+x /usr/local/bin/readsb-gain From e5bfd43847988b0a2db6c8e7de74594a16fc41e7 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Sun, 3 Nov 2024 17:46:00 +0100 Subject: [PATCH 4/4] readsb-gain: allow changing gain without restarting the service --- readsb-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readsb-install.sh b/readsb-install.sh index 89cbe5b..b674e27 100755 --- a/readsb-install.sh +++ b/readsb-install.sh @@ -231,7 +231,7 @@ gain="$1" if ! [[ $gain =~ $validre ]] ; then echo "Error, invalid gain!"; exit 1; fi if ! grep gain /etc/default/readsb &>/dev/null; then sudo sed -i -e 's/RECEIVER_OPTIONS="/RECEIVER_OPTIONS="--gain 49.6 /' /etc/default/readsb; fi sudo sed -i -E -e "s/--gain[ =][^ \"]*/--gain $gain/" /etc/default/readsb -sudo systemctl restart readsb +echo "$gain" | sudo tee /run/readsb/setGain || sudo systemctl restart readsb EOF chmod a+x /usr/local/bin/readsb-gain