diff --git a/root/etc/cont-init.d/28-fix b/root/etc/cont-init.d/28-fix index 367bf2e..4c2bece 100755 --- a/root/etc/cont-init.d/28-fix +++ b/root/etc/cont-init.d/28-fix @@ -13,7 +13,15 @@ # Blog: https://p3terx.com (chinese) #================================================= -[[ -e /config/HelloWorld ]] && exit 0 +[[ $(grep 'root/.aria2' /config/aria2.conf) ]] && { + sed -i "s@root/.aria2@config@" /config/aria2.conf + sed -i "s@^\(rpc-listen-port=\).*@\16800@" /config/aria2.conf + sed -i "s@^\(listen-port=\).*@\16888@" /config/aria2.conf + sed -i "s@^\(dht-listen-port=\).*@\16888@" /config/aria2.conf +} + +[[ $(grep 'root/.aria2' /config/*.sh) ]] && + sed -i "s@root/.aria2@config@" /config/*.sh sed -i "s@^\(DOWNLOAD_PATH='\).*@\1/downloads'@" /config/*.sh @@ -23,6 +31,8 @@ sed -i "s@^\(save-session=\).*@\1/config/aria2.session@" /config/aria2.conf sed -i "s@^\(dht-file-path=\).*@\1/config/dht.dat@" /config/aria2.conf sed -i "s@^\(dht-file-path6=\).*@\1/config/dht6.dat@" /config/aria2.conf +[[ -e /config/HelloWorld ]] && exit 0 + [[ $RPC_PORT ]] && sed -i "s@^\(rpc-listen-port=\).*@\1$RPC_PORT@" /config/aria2.conf @@ -48,11 +58,4 @@ sed -i "s@^\(dht-file-path6=\).*@\1/config/dht6.dat@" /config/aria2.conf [[ "$SPECIAL_MODE" = "move" ]] && sed -i 's@^\(on-download-complete=\).*@\1/config/move.sh@' /config/aria2.conf -[[ $(grep 'root/.aria2' /config/aria2.conf) ]] && { - sed -i "s@root/.aria2@config@" /config/aria2.conf - sed -i "s@^\(rpc-listen-port=\).*@\16800@" /config/aria2.conf - sed -i "s@^\(listen-port=\).*@\16888@" /config/aria2.conf - sed -i "s@^\(dht-listen-port=\).*@\16888@" /config/aria2.conf -} - exit 0