🗃️ Committing everything that changed 🗃️
All checks were successful
release-tag / release-image (push) Successful in 4m56s

rootfs/opt/echoip/html/index.html
rootfs/usr/local/etc/docker/init.d/zz-echoip.sh
This commit is contained in:
casjay 2025-06-11 11:01:15 -04:00
parent f35189b635
commit fef504066e
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145
2 changed files with 19 additions and 6 deletions

View File

@ -342,9 +342,12 @@
>.
</p>
<br /><br /><br />
<h5 class="center">hosted on REPLACE_HOST_NAME</h5><br />
<h5 class="center">Server IPV4: REPLACE_CURRENT_IP_4</h5><br />
<h5 class="center">Last updated on REPLACE_MODIFIED</h5>
<h5 class="center">
hosted on REPLACE_HOST_NAME<br />
Server IPV4: REPLACE_CURRENT_IP_4<br />
Server IPV6: REPLACE_CURRENT_IP_6<br />
Last updated on REPLACE_MODIFIED
</h5>
</div>
</div>
</div>

View File

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