update IP on shell after change IP of LXC #223

Closed
opened 2026-02-04 17:13:01 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @gianlucaf81 on GitHub (Dec 28, 2024).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

Jellyfin but it's the same for everyone

📂 What was the exact command used to execute the script?

bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/jellyfin.sh)"

📝 Provide a clear and concise description of the issue.

if I change the IP of the container when starting the shell I don't get the string with the updated IP.

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

🔄 Steps to reproduce the issue.

  1. do any lxc with DHCP
  2. try to change the ip of the lxc
  3. restart the container

Paste the full error output (if available).

`jellyfin login: root (automatic login)

Jellyfin LXC Container
🌐 Provided by: community-scripts ORG | GitHub: https://github.com/community-scripts/ProxmoxVE

🖥️   OS: Debian GNU/Linux - Version: 12
🏠   Hostname: jellyfin
💡   IP Address: 192.168.1.141

Last login: Sat Dec 28 08:54:16 CET 2024 on tty1
root@jellyfin:# ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0@if14: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether bc:24:11:5f:26:12 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.1.101/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
root@jellyfin:
# `

🖼️ Additional context (optional).

image

Originally created by @gianlucaf81 on GitHub (Dec 28, 2024). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? Jellyfin but it's the same for everyone ### 📂 What was the exact command used to execute the script? bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/jellyfin.sh)" ### 📝 Provide a clear and concise description of the issue. if I change the IP of the container when starting the shell I don't get the string with the updated IP. ### ⚙️ What settings are you using? - [X] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 🔄 Steps to reproduce the issue. 1. do any lxc with DHCP 2. try to change the ip of the lxc 3. restart the container ### ❌ Paste the full error output (if available). `jellyfin login: root (automatic login) Jellyfin LXC Container 🌐 Provided by: community-scripts ORG | GitHub: https://github.com/community-scripts/ProxmoxVE 🖥️ OS: Debian GNU/Linux - Version: 12 🏠 Hostname: jellyfin 💡 IP Address: 192.168.1.141 Last login: Sat Dec 28 08:54:16 CET 2024 on tty1 root@jellyfin:~# ip address 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: eth0@if14: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether bc:24:11:5f:26:12 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 192.168.1.101/24 brd 192.168.1.255 scope global eth0 valid_lft forever preferred_lft forever root@jellyfin:~# ` ### 🖼️ Additional context (optional). ![image](https://github.com/user-attachments/assets/c01bd0f8-41dc-43ac-b0de-ce973e58a74a)
OVERLORD added the not a script issue label 2026-02-04 17:13:01 +03:00
Author
Owner

@oOStroudyOo commented on GitHub (Dec 28, 2024):

I don't believe it's possible to add anything dynamic in the motd (message of the day).

I think this would require a Cron job at every reboot to update the motd with the current IP address.

@oOStroudyOo commented on GitHub (Dec 28, 2024): I don't believe it's possible to add anything dynamic in the motd (message of the day). I think this would require a Cron job at every reboot to update the motd with the current IP address.
Author
Owner

@michelroegl-brunner commented on GitHub (Dec 28, 2024):

Exactly as Stroud said above. No script issue.

@michelroegl-brunner commented on GitHub (Dec 28, 2024): Exactly as Stroud said above. No script issue.
Author
Owner

@oOStroudyOo commented on GitHub (Dec 28, 2024):

Rather than it being raised as an issue, you could raise this as an idea in discussion.

It wouldn't take somebody too long to create a helper-script for dynamic IP Cron jobs for the motd.

@oOStroudyOo commented on GitHub (Dec 28, 2024): Rather than it being raised as an issue, you could raise this as an idea in discussion. It wouldn't take somebody too long to create a helper-script for dynamic IP Cron jobs for the motd.
Author
Owner

@akhdanfadh commented on GitHub (Jan 5, 2025):

For a debian/ubuntu distribution, remove /etc/motd and add this script to /etc/update-motd.d/ as 01-tteck for example. Then make it executable, e.g., chmod +x /etc/update-motd.d/01-tteck. Reboot and you'll see.

#!/bin/sh

OS_NAME=$(grep '^NAME=' /etc/os-release | cut -d '"' -f 2)
OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -d '"' -f 2)
HOSTNAME=$(hostname)
IP_ADDRESS=$(hostname -I | awk '{print $1}')

echo ""
echo "\033[1mTraefik LXC Container\033[0m"
echo "    🌐  \033[0m\033[33m Provided by: \033[1;92mcommunity-scripts ORG \033[33m| GitHub: \033[1;92mhttps://github.com/community-scripts/ProxmoxVE\033[0m"
echo ""
echo "    🖥️  \033[0m\033[33m OS: \033[1;92m${OS_NAME} - Version: ${OS_VERSION}\033[0m"
echo "    🏠  \033[0m\033[33m Hostname: \033[1;92m${HOSTNAME}\033[0m"
echo "    💡  \033[0m\033[33m IP Address: \033[1;92m${IP_ADDRESS}\033[0m"
@akhdanfadh commented on GitHub (Jan 5, 2025): For a debian/ubuntu distribution, remove `/etc/motd` and add this script to `/etc/update-motd.d/` as `01-tteck` for example. Then make it executable, e.g., `chmod +x /etc/update-motd.d/01-tteck`. Reboot and you'll see. ```bash #!/bin/sh OS_NAME=$(grep '^NAME=' /etc/os-release | cut -d '"' -f 2) OS_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -d '"' -f 2) HOSTNAME=$(hostname) IP_ADDRESS=$(hostname -I | awk '{print $1}') echo "" echo "\033[1mTraefik LXC Container\033[0m" echo " 🌐 \033[0m\033[33m Provided by: \033[1;92mcommunity-scripts ORG \033[33m| GitHub: \033[1;92mhttps://github.com/community-scripts/ProxmoxVE\033[0m" echo "" echo " 🖥️ \033[0m\033[33m OS: \033[1;92m${OS_NAME} - Version: ${OS_VERSION}\033[0m" echo " 🏠 \033[0m\033[33m Hostname: \033[1;92m${HOSTNAME}\033[0m" echo " 💡 \033[0m\033[33m IP Address: \033[1;92m${IP_ADDRESS}\033[0m" ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#223