From fef504066e8f9e663c952a58db51254d1b86376c Mon Sep 17 00:00:00 2001 From: casjay Date: Wed, 11 Jun 2025 11:01:15 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/opt/echoip/html/index.html rootfs/usr/local/etc/docker/init.d/zz-echoip.sh --- rootfs/opt/echoip/html/index.html | 9 ++++++--- rootfs/usr/local/etc/docker/init.d/zz-echoip.sh | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/rootfs/opt/echoip/html/index.html b/rootfs/opt/echoip/html/index.html index 8b9008f..50f32d2 100644 --- a/rootfs/opt/echoip/html/index.html +++ b/rootfs/opt/echoip/html/index.html @@ -342,9 +342,12 @@ >.




-
hosted on REPLACE_HOST_NAME

-
Server IPV4: REPLACE_CURRENT_IP_4

-
Last updated on REPLACE_MODIFIED
+
+ hosted on REPLACE_HOST_NAME
+ Server IPV4: REPLACE_CURRENT_IP_4
+ Server IPV6: REPLACE_CURRENT_IP_6
+ Last updated on REPLACE_MODIFIED +
diff --git a/rootfs/usr/local/etc/docker/init.d/zz-echoip.sh b/rootfs/usr/local/etc/docker/init.d/zz-echoip.sh index fde251d..1b24610 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-echoip.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-echoip.sh @@ -166,6 +166,7 @@ __update_conf_files() { local exitCode=0 # default exit code local sysname="${SERVER_NAME:-${FULL_DOMAIN_NAME:-$HOSTNAME}}" # set hostname local host_ip_4="${HOST_IP_4:-CURRENT_IP_4}" + local host_ip_6="${HOST_IP_6:-CURRENT_IP_6}" # CD into temp to bybass any permission errors #cd /tmp || false # lets keep shellcheck happy by adding false @@ -198,9 +199,18 @@ __update_conf_files() { # custom commands [ -d "/data/echoip" ] && cp -Rf "/data/echoip/." "/opt/echoip/" - sed -i "s|REPLACE_HOST_NAME|$sysname|g" opt/echoip/html/index.html - sed -i "s|REPLACE_CURRENT_IP_4|$host_ip_4|g" opt/echoip/html/index.html + sed -i "s|REPLACE_HOST_NAME|$sysname|g" /opt/echoip/html/index.html sed -i "s|REPLACE_MODIFIED|$(date +'%Y-%m-%d at %H:%M')|g" /opt/echoip/html/index.html + if [ -n "$host_ip_4" ]; then + sed -i "s|REPLACE_CURRENT_IP_4|$host_ip_4|g" /opt/echoip/html/index.html + else + sed -i '/REPLACE_CURRENT_IP_4/d' /opt/echoip/html/index.html + fi + if [ -n "$host_ip_6" ]; then + sed -i "s|REPLACE_CURRENT_IP_6|$host_ip_6|g" /opt/echoip/html/index.html + else + sed -i '/REPLACE_CURRENT_IP_6/d' /opt/echoip/html/index.html + fi return $exitCode } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -236,7 +246,7 @@ __pre_execute() { done # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Replace the applications user and group - + # Replace variables HOSTNAME="$sysname" __initialize_replace_variables "$ETC_DIR" "$CONF_DIR" "$WWW_ROOT_DIR" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -