@@ -202,9 +202,6 @@ motd_ssh() {
202202 # Set terminal to 256-color mode
203203 grep -qxF "export TERM='xterm-256color'" /root/.bashrc || echo "export TERM='xterm-256color'" >> /root/.bashrc
204204
205- # Get the current private IP address
206- IP=$(hostname -I | awk '{print $1}') # Private IP
207-
208205 # Get OS information (Debian / Ubuntu)
209206 if [ -f "/etc/os-release" ]; then
210207 OS_NAME=$(grep ^NAME /etc/os-release | cut -d= -f2 | tr -d '"')
@@ -214,20 +211,14 @@ motd_ssh() {
214211 OS_VERSION=$(cat /etc/debian_version)
215212 fi
216213
217- # Set MOTD with application info, system details
218- MOTD_FILE="/etc/motd"
219- if [ -f "$MOTD_FILE" ]; then
220- # Start MOTD with application info and link
221- echo -e "\n${BOLD}${APPLICATION} LXC Container${CL}" > "$MOTD_FILE"
222- echo -e "${TAB}${GATEWAY}${YW} Provided by: ${GN}community-scripts ORG ${YW}| GitHub: ${GN}https://github.com/community-scripts/ProxmoxVE${CL}\n" >> "$MOTD_FILE"
223-
224- # Add system information with icons
225- echo -e "${TAB}${OS}${YW} OS: ${GN}${OS_NAME} - Version: ${OS_VERSION}${CL}" >> "$MOTD_FILE"
226- echo -e "${TAB}${HOSTNAME}${YW} Hostname: ${GN}$(hostname)${CL}" >> "$MOTD_FILE"
227- echo -e "${TAB}${INFO}${YW} IP Address: ${GN}${IP}${CL}" >> "$MOTD_FILE"
228- else
229- echo "MotD file does not exist!" >&2
230- fi
214+ PROFILE_FILE="/etc/profile.d/00_lxc-details.sh"
215+ echo "echo -e \"\"" > "$PROFILE_FILE"
216+ echo -e "echo -e \"${BOLD}${APPLICATION} LXC Container${CL}"\" >> "$PROFILE_FILE"
217+ 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"
218+ echo "echo \"\"" >> "$PROFILE_FILE"
219+ echo -e "echo -e \"${TAB}${OS}${YW} OS: ${GN}${OS_NAME} - Version: ${OS_VERSION}${CL}\"" >> "$PROFILE_FILE"
220+ echo -e "echo -e \"${TAB}${HOSTNAME}${YW} Hostname: ${GN}\$(hostname)${CL}\"" >> "$PROFILE_FILE"
221+ echo -e "echo -e \"${TAB}${INFO}${YW} IP Address: ${GN}\$(hostname -I | awk '{print \$1}')${CL}\"" >> "$PROFILE_FILE"
231222
232223 # Disable default MOTD scripts
233224 chmod -x /etc/update-motd.d/*
0 commit comments