extend hostname enquiry

For modern systemd-based systems (e.g. Arch), where command hostname might not exist anymore
This commit is contained in:
Andreas Schneider 2021-11-20 15:17:04 +01:00 • committed by GitHub
parent 66c5bb6d52
commit 146f329c24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -285,6 +285,8 @@ readonly LOG_DIR
# System information
readonly HOSTNAME="$(hostname)"
# Try command hostnamectl if HOSTNAME is unset or empty
[ -z HOSTNAME ] && readonly HOSTNAME="$(hostnamectl --static)"
readonly OS_FLAVOR="$(uname)"
# SMART static information