#!/usr/bin/with-contenv bash # _ _ ____ ____ # / \ _ __(_) __ _|___ \ | _ \ _ __ ___ # / _ \ | '__| |/ _` | __) | | |_) | '__/ _ \ # / ___ \| | | | (_| |/ __/ | __/| | | (_) | # /_/ \_\_| |_|\__,_|_____| |_| |_| \___/ # # https://github.com/P3TERX/Aria2-Pro-Docker # # Copyright (c) 2020-2021 P3TERX # # This is free software, licensed under the MIT License. # See /LICENSE for more information. . /etc/init-base if [ -w ${DOWNLOAD_DIR} ]; then echo "Download DIR writeable, not changing owner."; else chown -R p3terx:p3terx ${DOWNLOAD_DIR}; fi chown -R p3terx:p3terx ${ARIA2_CONF_DIR} if [[ -z ${PUID} && -z ${PGID} ]] || [[ ${PUID} = 65534 && ${PGID} = 65534 ]]; then echo -e "${WARN} Ignore permission settings." chmod -v 777 ${DOWNLOAD_DIR} chmod -vR 777 ${ARIA2_CONF_DIR} else if [ -w ${DOWNLOAD_DIR} ]; then echo "Download DIR writeable, not modifying permission."; else chmod -v u=rwx ${DOWNLOAD_DIR}; fi chmod -v 600 ${ARIA2_CONF_DIR}/* chmod -v 755 ${SCRIPT_DIR} chmod -v 700 ${SCRIPT_DIR}/* fi