2013-07-22 17:57:18 +02:00
|
|
|
#!/usr/bin/env bash
|
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)
|
2022-02-01 12:41:53 +01:00
|
|
|
#shellcheck disable=SC2129
|
2022-01-25 16:51:22 +01:00
|
|
|
echo -e "\033[1mWelcome to \033[36mArch Linux \033[34m(archboot environment)\033[0m" >> "${MOTD}"
|
|
|
|
echo -e "\033[1m--------------------------------------------\033[0m" >> "${MOTD}"
|
|
|
|
echo -e "\033[1mConsoles:\033[0m" >> "${MOTD}"
|
|
|
|
echo -e " - Virtual consoles \033[1m1-6\033[0m are active." >> "${MOTD}"
|
|
|
|
echo -e " - To change virtual console use \033[32mALT + F(1-6)\033[0m" >> "${MOTD}"
|
2022-01-21 14:16:33 +01:00
|
|
|
if echo "${HOOKS[@]}" | grep -q archboot_keymap ; then
|
2022-01-25 16:51:22 +01:00
|
|
|
echo -e "\033[1mChange keymap and console font:\033[0m" >> "${MOTD}"
|
|
|
|
echo -e " - To change to a non-US keymap, type \033[32m'km'\033[0m at the console." >> "${MOTD}"
|
2008-12-06 19:12:19 +01:00
|
|
|
fi
|
2022-01-21 14:16:33 +01:00
|
|
|
if echo "${HOOKS[@]}" | grep -q archboot_tz; then
|
2022-01-25 16:51:22 +01:00
|
|
|
echo -e "\033[1mChange time and date:\033[0m" >> "${MOTD}"
|
|
|
|
echo -e " - To change your time and date, type \033[32m'tz'\033[0m at the console." >> "${MOTD}"
|
2008-12-06 19:12:19 +01:00
|
|
|
fi
|
2022-01-21 14:16:33 +01:00
|
|
|
if echo "${HOOKS[@]}" | grep -q archboot_installer; then
|
2022-02-01 12:41:53 +01:00
|
|
|
#shellcheck disable=SC2129
|
2022-01-25 16:51:22 +01:00
|
|
|
echo -e "\033[1mNormal Setup:\033[0m" >> "${MOTD}"
|
|
|
|
echo -e " - On first login \033[1msetup\033[0m is launched automatically." >> "${MOTD}"
|
|
|
|
echo -e " - Please run \033[32m'setup'\033[0m again to install Arch Linux if you left setup." >> "${MOTD}"
|
2022-01-25 17:07:32 +01:00
|
|
|
echo -e " - Virtual console 7 is used for setup logging, use \033[32mALT + F7\033[0m." >> "${MOTD}"
|
|
|
|
echo -e " - Run \033[32m'update-installer.sh'\033[0m to get all update options of the installer." >> "${MOTD}"
|
2022-01-25 16:51:22 +01:00
|
|
|
echo -e "\033[1mFor Experts:\033[0m" >> "${MOTD}"
|
|
|
|
echo -e " - Use \033[32m'quickinst'\033[0m to install and bypass the setup routine." >> "${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
|
|
|
}
|