From f06daa780098e0979befdc733bb9cc38400ad827 Mon Sep 17 00:00:00 2001 From: Kroese Date: Thu, 20 Apr 2023 03:50:20 +0200 Subject: [PATCH] Display IP during boot --- agent/agent.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/agent/agent.sh b/agent/agent.sh index 397877f..7532930 100644 --- a/agent/agent.sh +++ b/agent/agent.sh @@ -134,9 +134,17 @@ fi # Display message in docker log output -echo "-------------------------------------------" -echo " You can now login to DSM at port 5000 " -echo "-------------------------------------------" +IP=$(ip address show dev eth0 | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/) + +if [[ "$IP" == "20.20"* ]]; then + MSG="port 5000" +else + MSG="http://${IP}:5000" +fi + +echo "--------------------------------------------------------" +echo " You can now login to DSM at ${MSG}" +echo "--------------------------------------------------------" # Wait for NMI interrupt as a shutdown signal