Skip to content

Commit

Permalink
Merge pull request #293 from mariux64/mkmotd-use-hostconfig
Browse files Browse the repository at this point in the history
Mkmotd use hostconfig
  • Loading branch information
donald authored Jan 3, 2023
2 parents 91f3a14 + 8209fe7 commit 707831a
Showing 1 changed file with 3 additions and 11 deletions.
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

0 comments on commit 707831a

Please sign in to comment.