{
  # Remove /etc/motd content which accidentaly was put in grub.cfg
  # during kernel upgrades, see BZ 9161
  my @bad_lines = (
    qr{^Before editing configuration files, familiarise$},
    qr{^yourself with the automated events and templates$},
    qr{^systems\.$},
    qr{^Please take the time to read the documentation$},
    qr{^http://wiki.contribs.org/Main_Page$},
    qr{^Remember that SME Server is free to download$},
    qr{^and use, but it is not free to build$},
    qr{^Please help the project :$},
    qr{^http://wiki.contribs.org/Donate},
    qr{^\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \(\d[\.\d\-]*\.el6\.(x86_64|i[3-5]86)\)$}
  );
  my $title_re = qr{^title \*\*\*\*\*\*\*\*\*\*\*\* Welcome to SME Server 9\.[01] \*\*\*\*\*\*\*\*\*\*\*\*\*$};
  my @new_lines = ();
  foreach my $l (@lines){
    my $match = 0;
    foreach (@bad_lines){
      if ($l =~ m/$_/){
        $match = 1;
        last;
      }
    }
    push @new_lines, $l unless ($match);
  }
  @lines = @new_lines;
  @lines = map { s/$title_re/title SME Server $sysconfig{ReleaseVersion}/; $_ } @lines;
  $OUT = '';
}
