2013-07-22 17:57:18 +02:00
|
|
|
#!/usr/bin/env bash
|
2023-01-27 08:08:28 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2008-12-06 19:12:19 +01:00
|
|
|
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
|
|
|
|
2011-07-06 15:55:39 +02:00
|
|
|
build ()
|
2008-12-06 19:12:19 +01:00
|
|
|
{
|
|
|
|
### generate motd
|
2020-08-15 11:56:31 +02:00
|
|
|
MOTD=$(mktemp /var/tmp/motd.XXXX)
|
2023-02-07 20:19:31 +01:00
|
|
|
[[ "$(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}"
|
2022-06-25 08:36:47 +02:00
|
|
|
#shellcheck disable=SC2129
|
2023-02-07 20:19:31 +01:00
|
|
|
echo -e "\e[1m----------------------------------------\e[m" >> "${MOTD}"
|
2023-06-25 08:28:34 +02:00
|
|
|
echo -e "\e[1mConsole Configuration:\e[m" >> "${MOTD}"
|
2023-06-25 20:58:45 +02:00
|
|
|
echo -e " - Use the \e[1;92mALT + F1 - F6\e[m keys to change the virtual console." >> "${MOTD}"
|
2022-04-02 08:43:31 +02:00
|
|
|
if echo "${HOOKS[@]}" | grep -qw archboot_keymap ; then
|
2023-06-25 20:58:45 +02:00
|
|
|
echo -e " - Use the \e[1;92m'km'\e[m script to change to a non-US keymap." >> "${MOTD}"
|
2008-12-06 19:12:19 +01:00
|
|
|
fi
|
2023-07-12 12:17:36 +02:00
|
|
|
if echo "${HOOKS[@]}" | grep -qw archboot_net_common ; then
|
|
|
|
echo -e "\e[1mNetwork Configuration:\e[m" >> "${MOTD}"
|
2023-07-12 19:14:10 +02:00
|
|
|
echo -e " - Use the \e[1;92m'network'\e[m script to change your network settings." >> "${MOTD}"
|
2023-07-12 12:17:36 +02:00
|
|
|
fi
|
2022-04-02 08:43:31 +02:00
|
|
|
if echo "${HOOKS[@]}" | grep -qw archboot_tz; then
|
2023-06-25 08:28:34 +02:00
|
|
|
echo -e "\e[1mClock Configuration:\e[m" >> "${MOTD}"
|
2023-06-25 20:58:45 +02:00
|
|
|
echo -e " - Use the \e[1;92m'tz'\e[m script to change your time and date." >> "${MOTD}"
|
2008-12-06 19:12:19 +01:00
|
|
|
fi
|
2022-04-02 08:43:31 +02:00
|
|
|
if echo "${HOOKS[@]}" | grep -qw archboot_net; then
|
2022-04-30 17:43:06 +02:00
|
|
|
#shellcheck disable=SC2129
|
2023-06-25 21:19:14 +02:00
|
|
|
echo -e "\e[1mFor Additional Wi-Fi Authentification Or Online Help:\e[m" >> "${MOTD}"
|
2023-02-12 19:45:06 +01:00
|
|
|
echo -e " - Use the \e[1;92m'elinks'\e[m text mode browser." >> "${MOTD}"
|
2023-06-25 15:59:03 +02:00
|
|
|
echo -e "\e[1mIRC Support Channel:\e[m" >> "${MOTD}"
|
2023-02-12 19:45:06 +01:00
|
|
|
echo -e " - Use the \e[1;92m'weechat'\e[m IRC client." >> "${MOTD}"
|
2022-04-02 08:43:31 +02:00
|
|
|
fi
|
|
|
|
if echo "${HOOKS[@]}" | grep -qw archboot_installer; then
|
2023-02-07 20:19:31 +01:00
|
|
|
echo -e "\e[1mManage Archboot Environment:\e[m" >> "${MOTD}"
|
2023-06-30 07:20:04 +02:00
|
|
|
echo -e " - Use the \e[1;92m'update'\e[m script." >> "${MOTD}"
|
2023-01-28 08:54:58 +01:00
|
|
|
#shellcheck disable=SC2129
|
2023-07-07 20:13:51 +02:00
|
|
|
echo -e "\e[1mInstallation Or Installation For Experts:\e[m" >> "${MOTD}"
|
2023-07-07 23:01:01 +02:00
|
|
|
echo -e " - Use the \e[1;92m'setup'\e[m or \e[1;92m'quickinst'\e[m script." >> "${MOTD}"
|
2008-12-06 19:12:19 +01:00
|
|
|
fi
|
2022-01-21 12:27:31 +01:00
|
|
|
chmod 644 "${MOTD}"
|
2008-12-06 19:12:19 +01:00
|
|
|
add_file "${MOTD}" "/etc/motd"
|
|
|
|
}
|
|
|
|
|
|
|
|
help ()
|
|
|
|
{
|
|
|
|
cat <<HELPEOF
|
|
|
|
This hook sets up dynamically the motd message, depending on
|
|
|
|
your system.
|
|
|
|
HELPEOF
|
2013-07-22 17:57:18 +02:00
|
|
|
}
|
2023-01-27 08:08:28 +01:00
|
|
|
# vim: set ft=sh ts=4 sw=4 et:
|