-
Hi |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
/etc/motd |
Beta Was this translation helpful? Give feedback.
-
Welcome Message but no file |
Beta Was this translation helpful? Give feedback.
-
If anyone add the Welcome-Banner to old installations or anything else: 1.) Create an new File: nano set_motd.sh 2.) add following lines: #!/bin/bash
# Function to set MOTD
set_motd() {
# Define colors and icons
YW=$(echo "\033[33m")
GN=$(echo "\033[1;92m")
CL=$(echo "\033[m")
TAB=" "
GATEWAY="${TAB}🌐${TAB}${CL}"
OS="${TAB}🖥️${TAB}${CL}"
HOSTNAME="${TAB}🏠${TAB}${CL}"
INFO="${TAB}💡${TAB}${CL}"
# Get OS information
if [ -f "/etc/os-release" ]; then
OS_NAME=$(grep ^NAME /etc/os-release | cut -d= -f2 | tr -d '"')
OS_VERSION=$(grep ^VERSION_ID /etc/os-release | cut -d= -f2 | tr -d '"')
elif [ -f "/etc/debian_version" ]; then
OS_NAME="Debian"
OS_VERSION=$(cat /etc/debian_version)
fi
# Set MOTD file
PROFILE_FILE="/etc/profile.d/00_motd.sh"
echo "echo -e \"\"" >"$PROFILE_FILE"
echo -e "echo -e \"${TAB}${GATEWAY}${YW} Provided by: ${GN}community-scripts ORG ${YW}| GitHub: ${GN}https://github.com/community-scripts/ProxmoxVE${CL}\"" >>"$PROFILE_FILE"
echo "echo \"\"" >>"$PROFILE_FILE"
echo -e "echo -e \"${TAB}${OS}${YW} OS: ${GN}${OS_NAME} - Version: ${OS_VERSION}${CL}\"" >>"$PROFILE_FILE"
echo -e "echo -e \"${TAB}${HOSTNAME}${YW} Hostname: ${GN}\$(hostname)${CL}\"" >>"$PROFILE_FILE"
echo -e "echo -e \"${TAB}${INFO}${YW} IP Address: ${GN}\$(hostname -I | awk '{print \$1}')${CL}\"" >>"$PROFILE_FILE"
# Disable default MOTD scripts
chmod -x /etc/update-motd.d/*
echo -e "${GN}MOTD has been successfully set.${CL}"
}
# Execute the function
set_motd 3.) Set executable rights for MOTD chmod +x set_motd.sh 4.) execute the script ./set_motd.sh |
Beta Was this translation helpful? Give feedback.
-
Would LOVE a Nightscout community script for us diabetics! |
Beta Was this translation helpful? Give feedback.
If anyone add the Welcome-Banner to old installations or anything else:
1.) Create an new File:
2.) add following lines: