Skip to content

Commit

Permalink
mkmotd: Strip trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
pmenzel committed Feb 21, 2018
1 parent 6af4c94 commit e1f7a5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mkmotd/mkmotd.pl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ sub readstr {

sub policy { # policy('theinternet') --> ('zeile1,'zeile2',....)
my ($hostname)=@_;

open IN,'<','/etc/mxpolicy' or return ();
while (<IN>) {
if (/^\S/ && /\b$hostname\b/) {
Expand All @@ -84,7 +84,7 @@ sub policy { # policy('theinternet') --> ('zeile1,'zeile2',....)
if (/\s+\`\s*(.+)/) {
my $x = `$1`;chomp($x);
push @out,split(/\n/,$x);
}
}
}
return @out;
}
Expand Down Expand Up @@ -125,12 +125,12 @@ sub policy { # policy('theinternet') --> ('zeile1,'zeile2',....)
$T{SYSTEM}='';
{
my $sys = '';

# for i in /sys/devices/virtual/dmi/id/*_{name,vendor,version}; do echo -en "$i\t"; cat $i; done
# for i in /sys/devices/virtual/dmi/id/{product_{name,version},sys_vendor}; do echo -en "$i\t"; cat $i; done

# /sys/devices/virtual/dmi/id

my $pn = readstr('/sys/devices/virtual/dmi/id/product_name');
if ($pn =~ m/All Series|empty/) {
$pn = undef;
Expand Down

0 comments on commit e1f7a5e

Please sign in to comment.