archboot/usr/lib/initcpio/install/archboot_motd
Tobias Powalowski 7e1649aa0c shellcheck fixes
2023-09-04 09:47:58 +02:00

41 lines
1.8 KiB
Bash

#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# Created by Tobias Powalowski <tpowa@archlinux.org>
build ()
{
### generate motd
MOTD=$(mktemp /var/tmp/motd.XXXX)
[[ "$(uname -m)" == "x86_64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[m\e[1m - Arch Linux X86_64\e[m" >> "${MOTD}"
[[ "$(uname -m)" == "aarch64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[m\e[1m - Arch Linux AARCH64\e[m" >> "${MOTD}"
[[ "$(uname -m)" == "riscv64" ]] && echo -e "\e[1mWelcome to \e[36mArchboot\e[m\e[1m - Arch Linux RISCV64\e[m" >> "${MOTD}"
#shellcheck disable=SC2129
echo -e "\e[1m----------------------------------------\e[m" >> "${MOTD}"
echo -e "\e[1mVconsole:\e[m" >> "${MOTD}"
echo -e " - Use the \e[1;92mALT + F1 - F12\e[m keys to change the virtual console." >> "${MOTD}"
if echo "${HOOKS[@]}" | grep -qw archboot_net; then
#shellcheck disable=SC2129
echo -e "\e[1mFor Additional Wi-Fi Authentification Or Online Help:\e[m" >> "${MOTD}"
echo -e " - Use the \e[1;92m'elinks'\e[m text mode browser." >> "${MOTD}"
echo -e "\e[1mIRC Support Channel:\e[m" >> "${MOTD}"
echo -e " - Use the \e[1;92m'weechat'\e[m IRC client." >> "${MOTD}"
fi
if echo "${HOOKS[@]}" | grep -qw archboot_installer; then
#shellcheck disable=SC2129
echo -e "\e[1mManage Archboot Environment:\e[m" >> "${MOTD}"
echo -e " - Use the \e[1;92m'launcher'\e[m or the expert \e[1;92m'update'\e[m script." >> "${MOTD}"
echo -e "\e[1mInstallation:\e[m" >> "${MOTD}"
echo -e " - Use the \e[1;92m'setup'\e[m or the expert \e[1;92m'quickinst'\e[m script." >> "${MOTD}"
fi
chmod 644 "${MOTD}"
add_file "${MOTD}" "/etc/motd"
}
help ()
{
cat <<HELPEOF
This hook sets up dynamically the motd message, depending on
your system.
HELPEOF
}
# vim: set ft=sh ts=4 sw=4 et: