🗃️ Committing everything that changed 🗃️

rootfs/usr/local/etc/docker/init.d/00-aria2c.sh
This commit is contained in:
casjay 2025-05-13 18:57:14 -04:00
parent 994211c426
commit 1b17b5711c
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145

View File

@ -229,6 +229,7 @@ __update_conf_files() {
local get_session_file="$(grep -Rs 'aria2.session' "/config/aria2/aria2.conf" | awk -F'=' '{print $2}' | head -n1)" local get_session_file="$(grep -Rs 'aria2.session' "/config/aria2/aria2.conf" | awk -F'=' '{print $2}' | head -n1)"
local rpc_port="${RPC_PORT:-${RPC_LISTEN:-6800}}" local rpc_port="${RPC_PORT:-${RPC_LISTEN:-6800}}"
local dht_port="$DHT_LISTEN_PORT" local dht_port="$DHT_LISTEN_PORT"
local secret_rpc_base64=""
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# delete files # delete files
#__rm "" #__rm ""
@ -242,10 +243,12 @@ __update_conf_files() {
__replace "REPLACE_SERVER_ADDR" "$CONTAINER_IP4_ADDRESS" "$CONF_DIR/aria-ng.config.js" __replace "REPLACE_SERVER_ADDR" "$CONTAINER_IP4_ADDRESS" "$CONF_DIR/aria-ng.config.js"
if [ -n "$RPC_SECRET" ]; then if [ -n "$RPC_SECRET" ]; then
echo "Changing rpc secret to $RPC_SECRET" echo "Changing rpc secret to $RPC_SECRET"
secret_secret_rpc_base64="$(echo -n "$RPC_SECRET" | base64 -w 0)"
if grep -sq "rpc-secret=" "$CONF_DIR/aria2.conf"; then if grep -sq "rpc-secret=" "$CONF_DIR/aria2.conf"; then
__replace "#rpc-secret=" "rpc-secret=" "$CONF_DIR/aria2.conf" __replace "#rpc-secret=" "rpc-secret=" "$CONF_DIR/aria2.conf"
__replace "REPLACE_RPC_SECRET" "$RPC_SECRET" "$CONF_DIR/aria2.conf" __replace "REPLACE_RPC_SECRET" "$RPC_SECRET" "$CONF_DIR/aria2.conf"
__replace "REPLACE_RPC_SECRET" "$RPC_SECRET" "$CONF_DIR/aria-ng.config.js" echo "$secret_rpc_base64 >$CONF_DIR/aria-ng.config.js"
__replace "REPLACE_RPC_SECRET" "$secret_rpc_base64" "$CONF_DIR/aria-ng.config.js"
else else
echo "rpc-secret=$RPC_SECRET" >>"$CONF_DIR/aria2.conf" echo "rpc-secret=$RPC_SECRET" >>"$CONF_DIR/aria2.conf"
fi fi