diff --git a/Dockerfile b/Dockerfile index adf904a..97da926 100644 --- a/Dockerfile +++ b/Dockerfile @@ -96,8 +96,7 @@ RUN set -ex ; \ BASH_CMD="$(type -P bash)" ; [ -f "$BASH_CMD" ] && rm -rf "/bin/sh" && ln -sf "$BASH_CMD" "/bin/sh" RUN set -ex ; \ - ln -sf /opt/echoip/echoip /usr/local/bin/echoip ; \ - ln -sf /opt/echoip/echoip /usr/local/bin/ifconfig ; \ + ln -sf /opt/echoip/echoip /opt/echoip/ifconfig ; \ sed -i "s|REPLACE_MODIFIED|$(date +'%Y-%m-%d at %H:%M')|g" /opt/echoip/html/index.html; \ bash -c "/tmp/update-geoip-db.sh" diff --git a/rootfs/usr/local/bin/echoip b/rootfs/usr/local/bin/echoip new file mode 100755 index 0000000..99347ee --- /dev/null +++ b/rootfs/usr/local/bin/echoip @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +[ -n "$SERVICE_PORT" ] || SERVICE_PORT="80" +[ -n "$WORK_DIR" ] || WORK_DIR="/opt/echoip" +/opt/echoip/echoip -r -s -p -l :$SERVICE_PORT -H X-Real-IP -H x-forwarded-for -t $WORK_DIR/html -a $WORK_DIR/geoip/GeoLite2-ASN.mmdb -c $WORK_DIR/geoip/GeoLite2-City.mmdb -f $WORK_DIR/geoip/GeoLite2-Country.mmdb diff --git a/rootfs/usr/local/etc/docker/init.d/zz-echoip.sh b/rootfs/usr/local/etc/docker/init.d/zz-echoip.sh index 2488ae5..6089f94 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-echoip.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-echoip.sh @@ -119,10 +119,9 @@ SERVICE_UID="0" # set the user id SERVICE_GID="0" # set the group id # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # execute command variables - keep single quotes variables will be expanded later -EXEC_CMD_BIN='echoip' # command to execute -EXEC_CMD_ARGS='-r -s -p -l :$SERVICE_PORT -H X-Real-IP -H x-forwarded-for ' # command arguments -EXEC_CMD_ARGS+='-t $WORK_DIR/html -a $WORK_DIR/geoip/GeoLite2-ASN.mmdb -c $WORK_DIR/geoip/GeoLite2-City.mmdb -f $WORK_DIR/geoip/GeoLite2-Country.mmdb ' # command arguments -EXEC_PRE_SCRIPT='sleep 60' # execute script before +EXEC_CMD_BIN='echoip' # command to execute +EXEC_CMD_ARGS='' # command arguments +EXEC_PRE_SCRIPT='sleep 60' # execute script before # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Is this service a web server IS_WEB_SERVER="no"