mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
52 lines
2.4 KiB
Bash
52 lines
2.4 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[1mConsole Configuration:\e[m" >> "${MOTD}"
|
|
echo -e " - Virtual consoles \e[1m1 - 6\e[m are active." >> "${MOTD}"
|
|
echo -e " - Use \e[1;92mALT + F1 - F6\e[m to change virtual console" >> "${MOTD}"
|
|
if echo "${HOOKS[@]}" | grep -qw archboot_keymap ; then
|
|
echo -e " - Use the \e[1;92m'km'\e[m tool to change to a non-US keymap." >> "${MOTD}"
|
|
fi
|
|
if echo "${HOOKS[@]}" | grep -qw archboot_tz; then
|
|
echo -e "\e[1mClock Configuration:\e[m" >> "${MOTD}"
|
|
echo -e " - Use the \e[1;92m'tz'\e[m tool to change your time and date." >> "${MOTD}"
|
|
fi
|
|
if echo "${HOOKS[@]}" | grep -qw archboot_net; then
|
|
#shellcheck disable=SC2129
|
|
echo -e "\e[1mFor 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
|
|
echo -e "\e[1mManage Archboot Environment:\e[m" >> "${MOTD}"
|
|
echo -e " - Use the \e[1;92m'update-installer'\e[m tool." >> "${MOTD}"
|
|
#shellcheck disable=SC2129
|
|
echo -e "\e[1mInstallation:\e[m" >> "${MOTD}"
|
|
echo -e " - On first login the \e[92m'setup'\e[m tool is launched automatically." >> "${MOTD}"
|
|
echo -e " - Rerun \e[1;92m'setup'\e[m to continue installation." >> "${MOTD}"
|
|
echo -e "\e[1mFor Experts:\e[m" >> "${MOTD}"
|
|
echo -e " - Use the \e[1;92m'quickinst'\e[m tool." >> "${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:
|