]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fallback to `uname -n` on missing `hostname` in radtest (#4771)
authorChristian Hesse <mail@eworm.de>
Sun, 16 Oct 2022 11:39:24 +0000 (13:39 +0200)
committerGitHub <noreply@github.com>
Sun, 16 Oct 2022 11:39:24 +0000 (07:39 -0400)
This should work without inetutils being installed, so add a fallback.

Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Christian Hesse <mail@eworm.de>
src/bin/radtest.in

index 11e929147ac599191edea3a9aac62a2dcb17f2de..e15f92ed9b2d2e08fbab94588a6b107857f94d94 100644 (file)
@@ -100,7 +100,7 @@ if [ "$7" ]
 then
        nas=$7
 else
-       nas=`hostname`
+       nas=`(hostname || uname -n) 2>/dev/null | sed 1q`
 fi
 
 (