From 24f7ca300ffddbf47aa50612236e3ebe2e9a6a69 Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Mon, 8 Jul 2024 18:32:06 +0200 Subject: [PATCH] configure: use `hostnamectl` as fallback Some systems don't have the `hostname` command, but use hostnamectl instead. In this case, the script works, but emits an error. This "fix" is not very useful, because it's specific to radarcape hosts, but at least there is not a nasty error message displayed ;-) Signed-off-by: Frank Villaro-Dixon --- configure.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.sh b/configure.sh index f9af093..fa80e1b 100755 --- a/configure.sh +++ b/configure.sh @@ -106,7 +106,14 @@ RECEIVERALTITUDE="$ALT" INPUT="127.0.0.1:30005" INPUT_TYPE="dump1090" -if [[ $(hostname) == "radarcape" ]] || pgrep rcd &>/dev/null; then +if command -v hostname; then + hostname=$(hostname) +else + hostname=$(hostnamectl hostname) +fi + + +if [[ $hostname == "radarcape" ]] || pgrep rcd &>/dev/null; then INPUT="127.0.0.1:10003" INPUT_TYPE="radarcape_gps" fi