mirror of
https://github.com/casjaysdevdocker/ifconfig
synced 2025-06-27 15:48:52 -04:00
🗃️ Committing everything that changed 🗃️
All checks were successful
release-tag / release-image (push) Successful in 4m56s
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:
parent
f35189b635
commit
fef504066e
@ -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>
|
||||
|
@ -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
|
||||
}
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
Loading…
x
Reference in New Issue
Block a user