Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormboelen <michael@cisofy.com>2016-03-08 10:16:35 +0300
committermboelen <michael@cisofy.com>2016-03-08 10:16:35 +0300
commit94d0aaf8d4cc7066f15c181652fff8ebc74446d0 (patch)
treeba9735961b0bd4614d8b90627218f2bec3cc567f
parente9edd2dd0997e85264a657feff22c1baa748dd7a (diff)
Set default hostname if none was found
-rwxr-xr-xlynis1
1 files changed, 1 insertions, 0 deletions
diff --git a/lynis b/lynis
index eaf873f7..802c8cea 100755
--- a/lynis
+++ b/lynis
@@ -466,6 +466,7 @@
*)
HOSTNAME=`hostname -s 2> /dev/null` ;;
esac
+ if [ "${HOSTNAME}" = "" ]; then HOSTNAME="no-hostname"; fi
FQDN=`hostname 2> /dev/null`
if [ "${OS}" = "Linux" -a "${HOSTNAME}" = "${FQDN}" ]; then
FQDN=`hostname -f 2> /dev/null`