]> gitweb.morketsmerke.org Git - immudex-lhe.git/commitdiff
WdroĊĵenie immudex_hostname - BT #95
authorxf0r3m <jakubstasinski@protonmail.com>
Sat, 29 Jul 2023 14:52:47 +0000 (16:52 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Sat, 29 Jul 2023 14:52:47 +0000 (16:52 +0200)
tools/000/immudex_hostname

index 8aa9af1616389086ad367b83290ee3c051698782..83a3509eee8166b5558ac556ddb2213a9cb0ef7b 100755 (executable)
@@ -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