diff --git a/rootfs/usr/local/bin/entrypoint.sh b/rootfs/usr/local/bin/entrypoint.sh index 452a7d3..aa73bfa 100755 --- a/rootfs/usr/local/bin/entrypoint.sh +++ b/rootfs/usr/local/bin/entrypoint.sh @@ -90,7 +90,7 @@ LOCAL_BIN_DIR="${LOCAL_BIN_DIR:-/usr/local/bin}" DEFAULT_DATA_DIR="${DEFAULT_DATA_DIR:-/usr/local/share/template-files/data}" DEFAULT_CONF_DIR="${DEFAULT_CONF_DIR:-/usr/local/share/template-files/config}" DEFAULT_TEMPLATE_DIR="${DEFAULT_TEMPLATE_DIR:-/usr/local/share/template-files/defaults}" -CONTAINER_IP_ADDRESS="$(ip a 2>/dev/null | grep 'inet' | grep -v '127.0.0.1' | awk '{print $2}' | sed 's|/*||g')" +CONTAINER_IP_ADDRESS="$(ip a 2>/dev/null | grep 'inet' | grep -v '127.0.0.1' | awk '{print $2}' | sed 's|/.*||g')" [ -n "$HTTP_PORT" ] || [ -n "$HTTPS_PORT" ] || HTTP_PORT="$SERVICE_PORT" [ "$HTTPS_PORT" = "443" ] && HTTP_PORT="$HTTPS_PORT" && SSL_ENABLED="true" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rootfs/usr/local/bin/start-aria2.sh b/rootfs/usr/local/bin/start-aria2.sh index d5363aa..7eea395 100755 --- a/rootfs/usr/local/bin/start-aria2.sh +++ b/rootfs/usr/local/bin/start-aria2.sh @@ -109,6 +109,7 @@ if [ -f "/config/aria2/aria-ng.config.js" ]; then rm -Rf "$get_config" ln -sf "/config/aria2/aria-ng.config.js" "$get_config" ln -sf "/config/aria2/aria-ng.config.js" "/var/www/ariang/js/aria-ng-f1dd57abb9.min.js" + [ -n "$CONTAINER_IP_ADDRESS" ] && sed "s|127.0.0.1|$CONTAINER_IP_ADDRESS|g" "/config/aria2/aria-ng.config.js" fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if [ -n "$RPC_SECRET" ]; then diff --git a/rootfs/usr/local/share/template-files/config/aria2/aria-ng.config.js b/rootfs/usr/local/share/template-files/config/aria2/aria-ng.config.js index e1bcb4a..795a6c2 100755 --- a/rootfs/usr/local/share/template-files/config/aria2/aria-ng.config.js +++ b/rootfs/usr/local/share/template-files/config/aria2/aria-ng.config.js @@ -523,7 +523,7 @@ title: '${downspeed}, ${upspeed} - ${title}', titleRefreshInterval: 5e3, browserNotification: !1, - rpcAlias: '', + rpcAlias: 'aria2', rpcHost: '127.0.0.1', rpcPort: '8080', rpcInterface: 'jsonrpc',