Improve motd

Added gold colour.
Added TABS (A longer version of TAB for central heading / Reduced code).
Added building icon.
Added hammer and spanner icon (GitHub).
Change LXC Container title to more central location and in gold.
Added website URL.
Split the lines to show Org, Website and GitHub on separate lines.
Change Org icon to building.
Added the hammer and spanner emoji to GitHub line.
Changed IP icon from idea to network.
Added line break under the title for better readability.
Added line break under the IP address for better readability.
This commit is contained in:
oOStroudyOo 2024-12-20 23:17:21 +00:00 committed by GitHub
parent 1c4c3b71e3
commit 36ca80b8d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,6 +12,7 @@ color() {
BL=$(echo "\033[36m") BL=$(echo "\033[36m")
RD=$(echo "\033[01;31m") RD=$(echo "\033[01;31m")
GN=$(echo "\033[1;92m") GN=$(echo "\033[1;92m")
GD=$(echo "\033[38;5;214m")
# Formatting # Formatting
CL=$(echo "\033[m") CL=$(echo "\033[m")
@ -19,6 +20,7 @@ color() {
BOLD=$(echo "\033[1m") BOLD=$(echo "\033[1m")
HOLD=" " HOLD=" "
TAB=" " TAB=" "
TABS=" "
# System # System
RETRY_NUM=10 RETRY_NUM=10
@ -34,6 +36,9 @@ color() {
HOSTNAME="${TAB}🏠${TAB}${CL}" HOSTNAME="${TAB}🏠${TAB}${CL}"
GATEWAY="${TAB}🌐${TAB}${CL}" GATEWAY="${TAB}🌐${TAB}${CL}"
DEFAULT="${TAB}⚙️${TAB}${CL}" DEFAULT="${TAB}⚙️${TAB}${CL}"
GITHUB="${TAB}🛠️${TAB}${CL}"
ORG="${TAB}🏢${TAB}${CL}"
} }
# This function enables IPv6 if it's not disabled and sets verbose mode if the global variable is set to "yes" # This function enables IPv6 if it's not disabled and sets verbose mode if the global variable is set to "yes"
@ -218,13 +223,15 @@ motd_ssh() {
MOTD_FILE="/etc/motd" MOTD_FILE="/etc/motd"
if [ -f "$MOTD_FILE" ]; then if [ -f "$MOTD_FILE" ]; then
# Start MOTD with application info and link # Start MOTD with application info and link
echo -e "\n${BOLD}${APPLICATION} LXC Container${CL}" > "$MOTD_FILE" echo -e "\n${TABS}${BOLD}${GD}${APPLICATION} LXC Container${CL}\n" > "$MOTD_FILE"
echo -e "${TAB}${GATEWAY}${YW} Provided by: ${GN}community-scripts ORG ${YW}| GitHub: ${GN}https://github.com/community-scripts/ProxmoxVE${CL}\n" >> "$MOTD_FILE" echo -e "${TAB}${ORG}${YW} Provided by: ${GN}community-scripts ORG${CL}" >> "$MOTD_FILE"
echo -e "${TAB}${GATEWAY}${YW} Web: ${GN}https://helper-scripts.com/${CL}" >> "$MOTD_FILE"
echo -e "${TAB}${GITHUB}${YW} GitHub: ${GN}https://github.com/community-scripts/ProxmoxVE${CL}\n" >> "$MOTD_FILE"
# Add system information with icons # Add system information with icons
echo -e "${TAB}${OS}${YW} OS: ${GN}${OS_NAME} - Version: ${OS_VERSION}${CL}" >> "$MOTD_FILE" echo -e "${TAB}${OS}${YW} OS: ${GN}${OS_NAME} - Version: ${OS_VERSION}${CL}" >> "$MOTD_FILE"
echo -e "${TAB}${HOSTNAME}${YW} Hostname: ${GN}$(hostname)${CL}" >> "$MOTD_FILE" echo -e "${TAB}${HOSTNAME}${YW} Hostname: ${GN}$(hostname)${CL}" >> "$MOTD_FILE"
echo -e "${TAB}${INFO}${YW} IP Address: ${GN}${IP}${CL}" >> "$MOTD_FILE" echo -e "${TAB}${NETWORK}${YW} IP Address: ${GN}${IP}${CL}\n" >> "$MOTD_FILE"
else else
echo "MotD file does not exist!" >&2 echo "MotD file does not exist!" >&2
fi fi