From 86370566ead709e7a722f41b834a0346da0c3406 Mon Sep 17 00:00:00 2001 From: 1ennson Date: Fri, 26 Oct 2018 11:31:24 +0200 Subject: [PATCH] [fix] hide hostname in dmesg output --- hw-probe.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw-probe.pl b/hw-probe.pl index fc11ab9..5e0c64f 100644 --- a/hw-probe.pl +++ b/hw-probe.pl @@ -968,6 +968,13 @@ ($$) return $Content; } +sub hideHostname($) +{ + my $Content = $_[0]; + $Content=~s/(Set hostname to) <.+>\./$1 <...>./g; + return $Content; +} + sub hideIPs($) { my $Content = $_[0]; @@ -4992,6 +4999,7 @@ () listProbe("logs", "dmesg"); $Dmesg = runCmd("dmesg 2>&1"); $Dmesg = hideTags($Dmesg, "SerialNumber"); + $Dmesg = hideHostname($Dmesg); $Dmesg = hideMACs($Dmesg); writeLog($LOG_DIR."/dmesg", $Dmesg); } @@ -7271,6 +7279,7 @@ () my $Dmesg_Old = runCmd("journalctl -a -k -b -1 -o short-monotonic 2>/dev/null | grep -v systemd"); $Dmesg_Old=~s/\]\s+.*?\s+kernel:/]/g; $Dmesg_Old = hideTags($Dmesg_Old, "SerialNumber"); + $Dmesg_Old = hideHostname($Dmesg_Old); $Dmesg_Old = hideMACs($Dmesg_Old); writeLog($LOG_DIR."/dmesg.1", $Dmesg_Old); }