From 0d741eb363935066ceba3341cab53152f6cd102c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 12 Mar 2025 11:14:23 +0100 Subject: [PATCH] Update switch_from_VED_to_VE.sh --- misc/switch_from_VED_to_VE.sh | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/misc/switch_from_VED_to_VE.sh b/misc/switch_from_VED_to_VE.sh index 7b16977..ab0def9 100644 --- a/misc/switch_from_VED_to_VE.sh +++ b/misc/switch_from_VED_to_VE.sh @@ -50,16 +50,14 @@ function update_motd() { echo -e "${BL}[Debug]${GN} Processing container: ${BL}$container${CL} (OS: ${GN}$os${CL})" if [[ "$os" == "ubuntu" || "$os" == "debian" ]]; then - echo -e "${BL}[Debug]${GN} Entering Debian/Ubuntu MOTD update for container ${BL}$container${CL}" + echo -e "${BL}[Debug]${GN} Updating Debian/Ubuntu MOTD in ${BL}$container${CL}" pct exec "$container" -- bash -c " PROFILE_FILE='/etc/profile.d/00_motd.sh' - echo '[Debug] Creating MOTD file' > /tmp/motd_debug.log - echo 'echo -e \"\"" > \"\$PROFILE_FILE\"' >> /tmp/motd_debug.log + echo 'echo -e \"\"' > \"\$PROFILE_FILE\" echo 'echo -e \"🌐 Provided by: community-scripts ORG | GitHub: https://github.com/community-scripts/ProxmoxVE\"' >> \"\$PROFILE_FILE\" - echo '[Debug] Writing OS details' >> /tmp/motd_debug.log 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] Writing IP details' >> /tmp/motd_debug.log + echo 'echo -e \"🏠 Hostname: \$(hostname)\"' >> \"\$PROFILE_FILE\" echo 'echo -e \"💡 IP Address: \$(hostname -I | awk '\''{print \$1}'\'')\"' >> \"\$PROFILE_FILE\" chmod -x /etc/update-motd.d/* " @@ -67,7 +65,7 @@ function update_motd() { echo -e "${GN}[Debug] Finished Debian/Ubuntu MOTD update for ${BL}$container${CL}" elif [[ "$os" == "alpine" ]]; then - echo -e "${BL}[Debug]${GN} Entering Alpine MOTD update for container ${BL}$container${CL}" + 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 @@ -83,22 +81,16 @@ function update_motd() { 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 \"🖥️ 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: Wrote hostname & IP' >> /tmp/motd_debug.log + echo 'echo -e \"💡 IP Address: '\$IP'\"' >> \"\$PROFILE_FILE\" + echo '[Debug] Alpine: Finished writing MOTD' >> /tmp/motd_debug.log " echo -e "${GN}[Debug] Finished Alpine MOTD update for ${BL}$container${CL}" fi } - function remove_dev_tag() { container=$1 current_tags=$(pct config "$container" | awk '/^tags/ {print $2}')