Skip to content

Mkmotd use hostconfig #293

Merged
merged 2 commits into from
Jan 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions mkmotd/mkmotd.pl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
my ($os_release) = `/bin/os-release`;
chomp($os_release);

my @hostconfig = split " ",`hostconfig`;

our $TEMPLATE;

if ( $os_release eq 'mariux_x86_64' || $os_release eq 'mariux_i686' ) {
Expand Down Expand Up @@ -41,16 +43,7 @@

EOF

$TEMPLATE .= " / to bee or not to bee / ";

if ( -d '/node/tags' ) {
$_ = `ls /node/tags`;
s/\n/ /g;
$TEMPLATE .= "tags: $_";
}

$TEMPLATE .= "\n";

$TEMPLATE .= " / to bee or not to bee / tags: ".join(" ",@hostconfig)."\n";
}
else {
die "$os_release : unknown os_release\n";
Expand All @@ -70,7 +63,6 @@ sub readstr {

sub policy { # policy('theinternet') --> ('zeile1,'zeile2',....)
my ($hostname) = @_;
my @hostconfig=split(/ |\n/, `hostconfig`);
open IN, '<', '/etc/mxpolicy' or return ();
my @out;
while (<IN>) {
Expand Down