From: xf0r3m Date: Sat, 29 Jul 2023 14:52:47 +0000 (+0200) Subject: Wdrożenie immudex_hostname - BT #95 X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=925be991bc1dd15dc61a8852547463fd5659544d;p=immudex-lhe.git Wdrożenie immudex_hostname - BT #95 --- diff --git a/tools/000/immudex_hostname b/tools/000/immudex_hostname index 8aa9af1..83a3509 100755 --- a/tools/000/immudex_hostname +++ b/tools/000/immudex_hostname @@ -2,7 +2,7 @@ bootID=$(sed 's/-//g' /proc/sys/kernel/random/boot_id | cut -c 26-33); if hostnamectl > /dev/null 2>&1; then - hName="$(hostnamectl | grep 'Chassis' | cut -d ":" -f 2 | sed 's/\ //g')-${bootID}"; + hName="$(hostnamectl | grep 'Chassis' | cut -d ":" -f 2 | awk '{printf $1}')-${bootID}"; else hName="$(sudo dmidecode -s chassis-type | head -1 | tr [A-Z] [a-z])-${bootID}"; fi