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"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -