Skip to content

Commit

Permalink
Random aria2 executable file name
Browse files Browse the repository at this point in the history
  • Loading branch information
wy580477 committed May 17, 2022
1 parent bba4a07 commit d7f50b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion content/install_rclone.sh → content/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/sh

# Install Rclone
DIR_TMP="$(mktemp -d)"
VERSION="$(curl --retry 10 --retry-max-time 60 https://api.github.com/repos/rclone/rclone/releases/latest | jq .tag_name | sed 's/\"//g')"
wget -qO - https://github.com/rclone/rclone/releases/download/${VERSION}/rclone-${VERSION}-linux-amd64.zip | busybox unzip -qd ${DIR_TMP} -
install -m 755 ${DIR_TMP}/rclone-${VERSION}-linux-amd64/rclone /usr/bin
rm -rf ${DIR_TMP}
rm -rf ${DIR_TMP}

# Install Aria2
wget -qO - https://github.com/P3TERX/Aria2-Pro-Core/releases/download/1.36.0_2021.08.22/aria2-1.36.0-static-linux-amd64.tar.gz | tar -zxf - -C /usr/bin
File renamed without changes.
5 changes: 4 additions & 1 deletion content/service/aria2/run → content/service/2/run
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ else
sed -i "s|^on-bt-download-complete=/.aria2allinoneworkdir/aria2/.*.sh|on-bt-download-complete=/.aria2allinoneworkdir/aria2/clean.sh|g" /mnt/data/config/aria2.conf
fi

EXEC=$(head /dev/urandom |cksum |md5sum |cut -c 1-8)
mv /usr/bin/aria2c /usr/bin/${EXEC}

# Run aria2
exec 2>&1
exec aria2c --conf-path="/mnt/data/config/aria2.conf" \
exec ${EXEC} --conf-path="/mnt/data/config/aria2.conf" \
--enable-rpc \
--rpc-secret=${GLOBAL_PASSWORD} \
--rpc-listen-port=61800

0 comments on commit d7f50b8

Please sign in to comment.