🗃️ Committing everything that changed 🗃️

Dockerfile
rootfs/tmp/
rootfs/usr/local/etc/docker/init.d/zz-ifconfig.sh
This commit is contained in:
casjay 2024-07-07 12:13:47 -04:00
parent 861dde82fe
commit 2129197bcf
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145
3 changed files with 56 additions and 9 deletions

View File

@ -98,7 +98,8 @@ RUN set -ex ; \
RUN set -ex ; \
ln -sf /opt/echoip/echoip /usr/local/bin/echoip ; \
ln -sf /opt/echoip/echoip /usr/local/bin/ifconfig ; \
sed -i "s|REPLACE_MODIFIED|$(date +'%Y-%m-%d at %H:%M')|g" /opt/echoip/html/index.html
sed -i "s|REPLACE_MODIFIED|$(date +'%Y-%m-%d at %H:%M')|g" /opt/echoip/html/index.html; \
bash -c "/tmp/init.sh"
RUN set -ex ; \
echo 'Running cleanup' ; \

44
rootfs/tmp/init.sh Normal file
View File

@ -0,0 +1,44 @@
#!/usr/bin/env bash
# shellcheck shell=bash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
##@Version : 202407071207-git
# @@Author : Jason Hempstead
# @@Contact : git-admin@casjaysdev.pro
# @@License : LICENSE.md
# @@ReadME : init.sh --help
# @@Copyright : Copyright: (c) 2024 Jason Hempstead, Casjays Developments
# @@Created : Sunday, Jul 07, 2024 12:07 EDT
# @@File : init.sh
# @@Description : Update GeoIP databases
# @@Changelog : newScript
# @@TODO : Refactor code
# @@Other :
# @@Resource :
# @@Terminal App : no
# @@sudo/root : no
# @@Template : bash/system
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# shell check options
# shellcheck disable=SC2317
# shellcheck disable=SC2120
# shellcheck disable=SC2155
# shellcheck disable=SC2199
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
APPNAME="$(basename "$0")"
VERSION="202407071207-git"
HOME="${USER_HOME:-$HOME}"
USER="${SUDO_USER:-$USER}"
RUN_USER="${SUDO_USER:-$USER}"
SRC_DIR="${BASH_SOURCE%/*}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set bash options
trap 'exitCode=${exitCode:-$?};[ -n "$INIT_SH_TEMP_FILE" ] && [ -f "$INIT_SH_TEMP_FILE" ] && rm -Rf "$INIT_SH_TEMP_FILE" &>/dev/null' EXIT
#if [ ! -t 0 ] && { [[ "$1" = --term ]] || [ $# = 0 ]; }; then shift 1 && TERMINAL_APP="TRUE" myterminal -e "$APPNAME $*" && exit || exit 1; fi
[ "$1" = "--debug" ] && set -xo pipefail && export SCRIPT_OPTS="--debug" && export _DEBUG="on"
[ "$1" = "--raw" ] && export SHOW_RAW="true"
set -o pipefail
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
for f in GeoLite2-ASN GeoLite2-City GeoLite2-Country; do
curl -q -LSsf "https://github.com/P3TERX/GeoLite.mmdb/raw/download/$f.mmdb" -O /opt/echoip/geoip/$f.mmdb
[ -f "rootfs/opt/echoip/geoip/$f.mmdb" ] && echo "Installed $f.mmdb to /opt/echoip/geoip" || exit 10
done

View File

@ -120,14 +120,16 @@ SERVICE_GID="0" # set the group id
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# execute command variables - keep single quotes variables will be expanded later
EXEC_CMD_BIN='ifconfig' # command to execute
EXEC_CMD_ARGS='-r -s -p ' # command arguments
EXEC_CMD_ARGS+='-l :$SERVICE_PORT ' # command arguments
EXEC_CMD_ARGS+='-H X-Real-IP ' # command arguments
EXEC_CMD_ARGS+='-H x-forwarded-for ' # command arguments
EXEC_CMD_ARGS+='-a /opt/echoip/geoip/GeoLite2-ASN.mmdb ' # command arguments
EXEC_CMD_ARGS+='-c /opt/echoip/geoip/GeoLite2-City.mmdb ' # command arguments
EXEC_CMD_ARGS+='-f /opt/echoip/geoip/GeoLite2-Country.mmdb ' # command arguments
EXEC_CMD_ARGS+='-t /opt/echoip/html ' # command arguments
EXEC_CMD_ARGS="-r " # command arguments
EXEC_CMD_ARGS+="-s " # command arguments
EXEC_CMD_ARGS+="-p " # command arguments
EXEC_CMD_ARGS+="-l :$SERVICE_PORT " # command arguments
EXEC_CMD_ARGS+="-H X-Real-IP " # command arguments
EXEC_CMD_ARGS+="-H x-forwarded-for " # command arguments
EXEC_CMD_ARGS+="-a /opt/echoip/geoip/GeoLite2-ASN.mmdb " # command arguments
EXEC_CMD_ARGS+="-c /opt/echoip/geoip/GeoLite2-City.mmdb " # command arguments
EXEC_CMD_ARGS+="-f /opt/echoip/geoip/GeoLite2-Country.mmdb " # command arguments
EXEC_CMD_ARGS+="-t /opt/echoip/html " # command arguments
EXEC_PRE_SCRIPT='' # execute script before
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Is this service a web server