mirror of
https://github.com/casjaysdevdocker/ifconfig
synced 2025-01-18 06:34:22 -05:00
➕ Added: bin/ ➕
This commit is contained in:
parent
83bf7ad196
commit
4d70655028
33
bin/docker-entrypoint.sh
Executable file
33
bin/docker-entrypoint.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
GEOIP="-a /data/GeoLite2-ASN.mmdb -c /data/GeoLite2-City.mmdb -f /data/GeoLite2-Country.mmdb"
|
||||
OPTS="-H x-forwarded-for -r -s -p"
|
||||
CONFIG="-t /config/web"
|
||||
|
||||
export TZ="${TZ:-America/New_York}"
|
||||
export HOSTNAME="${HOSTNAME:-casjaysdev-ifconfig}"
|
||||
|
||||
[ -n "${TZ}" ] && echo "${TZ}" >/etc/timezone
|
||||
[ -n "${HOSTNAME}" ] && echo "${HOSTNAME}" >/etc/hostname
|
||||
[ -n "${HOSTNAME}" ] && echo "127.0.0.1 $HOSTNAME localhost" >/etc/hosts
|
||||
[ -f "/usr/share/zoneinfo/${TZ}" ] && ln -sf "/usr/share/zoneinfo/${TZ}" "/etc/localtime"
|
||||
|
||||
[ -f "/config/env" ] && . /config/env
|
||||
|
||||
case $1 in
|
||||
bash | sh | shell)
|
||||
exec /bin/bash -l
|
||||
;;
|
||||
healthcheck)
|
||||
curl -q -LSsf -I --fail http://localhost:8080/json || exit 10
|
||||
;;
|
||||
*)
|
||||
if [ -f /opt/echoip/echoip ]; then
|
||||
echo "starting echoip"
|
||||
/opt/echoip/echoip $GEOIP $OPTS $CONFIG
|
||||
else
|
||||
echo "echoip not found"
|
||||
exit 10
|
||||
fi
|
||||
;;
|
||||
esac
|
Loading…
x
Reference in New Issue
Block a user