#!/usr/bin/bash

# Copyright (c) 2020 Fedora CoreOS Authors. All rights reserved.
# Copyright (c) 2014 The CoreOS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Modified from the CoreOS repository: https://github.com/coreos/init/blob/master/scripts/motdgen

set -e

# Write distro release information to MOTD, in distro-specific color.

. /usr/lib/console-login-helper-messages/libutil.sh
. /usr/lib/console-login-helper-messages/motd.defs

source /usr/lib/os-release
OS_RELEASE_OUTDIR="${RUN_SNIPPETS}"
echo -e "\e[${ANSI_COLOR}m${PRETTY_NAME}\e[0m" \
    | write_via_tempfile "${OS_RELEASE_OUTDIR}/21_os_release.motd"
