40 lines
988 B
Plaintext

#!/usr/bin/with-contenv bash
# _ _ ____ ____
# / \ _ __(_) __ _|___ \ | _ \ _ __ ___
# / _ \ | '__| |/ _` | __) | | |_) | '__/ _ \
# / ___ \| | | | (_| |/ __/ | __/| | | (_) |
# /_/ \_\_| |_|\__,_|_____| |_| |_| \___/
#
# https://github.com/P3TERX/Aria2-Pro-Docker
#
# Copyright (c) 2020-2021 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
. /etc/init-base
mkdir -p ${ARIA2_CONF_DIR} ${SCRIPT_DIR} ${DOWNLOAD_DIR}
PROFILES="
aria2.conf
"
DOWNLOAD_PROFILE
[[ ! -f "${ARIA2_CONF_DIR}/aria2.session" ]] && {
rm -rf "${ARIA2_CONF_DIR}/aria2.session"
touch "${ARIA2_CONF_DIR}/aria2.session"
}
if ! [[ "${UPDATE_TRACKERS}" = "false" || "${UPDATE_TRACKERS}" = "disable" ]]; then
rm -f /etc/services.d/crond/down
PROFILES="tracker.sh"
DOWNLOAD_PROFILE
bash ${SCRIPT_DIR}/tracker.sh ${ARIA2_CONF}
else
touch /etc/services.d/crond/down
fi
exit 0