Compare commits

...

2 Commits

Author SHA1 Message Date
MickLesk
05229396a9 fix term 2026-05-22 08:06:01 +02:00
MickLesk
9f72815ed7 Suppress MOTD for non-interactive shells
Prevent profile scripts from printing the MOTD in non-interactive contexts. Add a tty check ([ -t 1 ] || return 0) to the generated /etc/profile.d/00_lxc-details.sh in alpine-install.func and install.func so the banner only shows for interactive sessions. In core.func, source /etc/profile.d/*.sh with stdout redirected to /dev/null so environment/PATH exports still apply but any banner output is suppressed when loading profiles programmatically.
2026-05-22 08:02:40 +02:00
4 changed files with 9 additions and 5 deletions

View File

@@ -183,7 +183,8 @@ motd_ssh() {
PROFILE_FILE="/etc/profile.d/00_lxc-details.sh"
echo "echo -e \"\"" >"$PROFILE_FILE"
echo "[ -t 1 ] || return 0" >"$PROFILE_FILE"
echo "echo -e \"\"" >>"$PROFILE_FILE"
echo -e "echo -e \"${BOLD}${APPLICATION} LXC Container${CL}"\" >>"$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"

View File

@@ -3643,7 +3643,7 @@ start() {
run_addon_updates
update_motd_ip
cleanup_lxc
elif ! command -v whiptail &>/dev/null || ! [ -t 0 ]; then
elif ! command -v whiptail &>/dev/null || ! [ -t 0 ] || [[ "$TERM" == "dumb" ]]; then
msg_info "No interactive terminal detected defaulting to silent update mode"
VERBOSE="no"
set_std_mode

View File

@@ -140,10 +140,12 @@ ensure_profile_loaded() {
[[ -n "${_PROFILE_LOADED:-}" ]] && return
command -v pveversion &>/dev/null && return
# Source all profile.d scripts to ensure PATH is complete
# Source all profile.d scripts to ensure PATH is complete.
# Redirect stdout to suppress banner/MOTD output (e.g. 00_lxc-details.sh)
# while still allowing env/PATH exports to take effect.
if [[ -d /etc/profile.d ]]; then
for script in /etc/profile.d/*.sh; do
[[ -r "$script" ]] && source "$script" || true
[[ -r "$script" ]] && source "$script" >/dev/null || true
done
fi

View File

@@ -456,7 +456,8 @@ motd_ssh() {
PROFILE_FILE="/etc/profile.d/00_lxc-details.sh"
echo "echo -e \"\"" >"$PROFILE_FILE"
echo "[ -t 1 ] || return 0" >"$PROFILE_FILE"
echo "echo -e \"\"" >>"$PROFILE_FILE"
echo -e "echo -e \"${BOLD}${APPLICATION} LXC Container${CL}"\" >>"$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"