From 37c7b21b99db347aa70f4a156219554f0ca86a0b Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 12 Mar 2025 11:17:33 +0100 Subject: [PATCH] Update switch_from_VED_to_VE.sh --- misc/switch_from_VED_to_VE.sh | 37 ++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/misc/switch_from_VED_to_VE.sh b/misc/switch_from_VED_to_VE.sh index ab0def9..8496358 100644 --- a/misc/switch_from_VED_to_VE.sh +++ b/misc/switch_from_VED_to_VE.sh @@ -67,25 +67,30 @@ function update_motd() { elif [[ "$os" == "alpine" ]]; then echo -e "${BL}[Debug]${GN} Updating Alpine MOTD in ${BL}$container${CL}" - pct exec "$container" -- /bin/sh -c " - echo '[Debug] Alpine: Start updating MOTD' > /tmp/motd_debug.log - echo 'export TERM=\"xterm-256color\"' >> /root/.bashrc - echo '[Debug] Alpine: Set TERM variable' >> /tmp/motd_debug.log + pct exec "$container" -- /bin/sh -c ' + echo "[Debug] Alpine: Start updating MOTD" > /tmp/motd_debug.log + echo "export TERM=\"xterm-256color\"" >> /root/.bashrc + echo "[Debug] Alpine: Set TERM variable" >> /tmp/motd_debug.log - IP=\$(ip -4 addr show eth0 | awk '/inet / {print \$2}' | cut -d/ -f1 | head -n 1) - echo '[Debug] Alpine: Fetched IP: '\$IP'' >> /tmp/motd_debug.log + IP=$(ip -4 addr show eth0 | awk "/inet / {print \$2}" | cut -d/ -f1 | head -n 1) + echo "[Debug] Alpine: Fetched IP: $IP" >> /tmp/motd_debug.log - PROFILE_FILE='/etc/profile.d/00_lxc-details.sh' - echo '[Debug] Alpine: Writing to profile file' >> /tmp/motd_debug.log + PROFILE_FILE="/etc/profile.d/00_lxc-details.sh" + echo "[Debug] Alpine: Writing to profile file" >> /tmp/motd_debug.log - echo 'echo -e \"\"' > \"\$PROFILE_FILE\" - echo 'echo -e \" LXC Container\"' >> \"\$PROFILE_FILE\" - echo 'echo -e \" 🌐 Provided by: community-scripts ORG | GitHub: https://github.com/community-scripts/ProxmoxVE\"' >> \"\$PROFILE_FILE\" - echo 'echo -e \"🖥️ OS: \$(grep ^NAME /etc/os-release | cut -d= -f2 | tr -d '\"') - Version: \$(grep ^VERSION_ID /etc/os-release | cut -d= -f2 | tr -d '\"')\"' >> \"\$PROFILE_FILE\" - echo 'echo -e \"🏠 Hostname: \$(hostname)\"' >> \"\$PROFILE_FILE\" - echo 'echo -e \"💡 IP Address: '\$IP'\"' >> \"\$PROFILE_FILE\" - echo '[Debug] Alpine: Finished writing MOTD' >> /tmp/motd_debug.log - " + echo "echo -e \"\"" > \"$PROFILE_FILE\" + echo "echo -e \" LXC Container\"" >> \"$PROFILE_FILE\" + echo "echo -e \" 🌐 Provided by: community-scripts ORG | GitHub: https://github.com/community-scripts/ProxmoxVE\"" >> \"$PROFILE_FILE\" + echo "[Debug] Alpine: Wrote MOTD header" >> /tmp/motd_debug.log + + echo "echo \"\"" >> \"$PROFILE_FILE\" + echo "echo -e \" 🖥️ OS: $(grep ^NAME /etc/os-release | cut -d= -f2 | tr -d '\"') - Version: $(grep ^VERSION_ID /etc/os-release | cut -d= -f2 | tr -d '\"')\"" >> \"$PROFILE_FILE\" + echo "[Debug] Alpine: Wrote OS details" >> /tmp/motd_debug.log + + echo "echo -e \"🏠 Hostname: $(hostname)\"" >> \"$PROFILE_FILE\" + echo "echo -e \"💡 IP Address: $IP\"" >> \"$PROFILE_FILE\" + echo "[Debug] Alpine: Wrote hostname & IP" >> /tmp/motd_debug.log + ' echo -e "${GN}[Debug] Finished Alpine MOTD update for ${BL}$container${CL}" fi