Added: bin/

This commit is contained in:
Jason 2022-02-27 19:41:07 -05:00
parent 83bf7ad196
commit 4d70655028
No known key found for this signature in database
GPG Key ID: 4F765975C1F0EE5F

33
bin/docker-entrypoint.sh Executable file
View 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