From 5ce937ff0040b7dab02d426a8ba5eb35d2bc6d4f Mon Sep 17 00:00:00 2001 From: DDSRem <73049927+DDSRem@users.noreply.github.com> Date: Tue, 30 Apr 2024 20:37:13 +0800 Subject: [PATCH] fix: failed to obtain xiaoya path --- all_in_one.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/all_in_one.sh b/all_in_one.sh index 767d14ac1..8873ddfd3 100644 --- a/all_in_one.sh +++ b/all_in_one.sh @@ -813,6 +813,8 @@ function install_xiaoya_alist_sync_data() { if [ ! -f ${DDSREM_CONFIG_DIR}/xiaoya_alist_config_dir.txt ]; then get_config_dir + else + CONFIG_DIR="$(cat ${DDSREM_CONFIG_DIR}/xiaoya_alist_config_dir.txt)" fi while true; do @@ -826,12 +828,12 @@ function install_xiaoya_alist_sync_data() { fi done - bash -c "$(curl --insecure -fsSL https://ddsrem.com/xiaoya/xiaoya_data_downloader.sh)" -s "$(cat ${DDSREM_CONFIG_DIR}/xiaoya_alist_config_dir.txt)" + bash -c "$(curl --insecure -fsSL https://ddsrem.com/xiaoya/xiaoya_data_downloader.sh)" -s "${CONFIG_DIR}" # 组合定时任务命令 CRON="0 */${sync_interval} * * * bash -c \"\$(curl --insecure -fsSL https://ddsrem.com/xiaoya/xiaoya_data_downloader.sh)\" -s \ -$(cat ${DDSREM_CONFIG_DIR}/xiaoya_alist_config_dir.txt) >> \ -$(cat ${DDSREM_CONFIG_DIR}/xiaoya_alist_config_dir.txt)/data/cron.log 2>&1" +${CONFIG_DIR} >> \ +${CONFIG_DIR}/data/cron.log 2>&1" if command -v crontab > /dev/null 2>&1; then crontab -l | grep -v xiaoya_data_downloader > /tmp/cronjob.tmp echo -e "${CRON}" >> /tmp/cronjob.tmp @@ -852,11 +854,11 @@ $(cat ${DDSREM_CONFIG_DIR}/xiaoya_alist_config_dir.txt)/data/cron.log 2>&1" local net_mode net_mode="$(docker inspect --format='{{range $m, $conf := .NetworkSettings.Networks}}{{$m}}{{end}}' "$(cat ${DDSREM_CONFIG_DIR}/container_name/xiaoya_alist_name.txt)")" if [ "$net_mode"x = "bridge"x ]; then - echo "http://127.0.0.1:81/data" > "$(cat ${DDSREM_CONFIG_DIR}/xiaoya_alist_config_dir.txt)"/download_url.txt + echo "http://127.0.0.1:81/data" > "${CONFIG_DIR}"/download_url.txt elif [ "$net_mode"x = "host"x ]; then - echo "http://127.0.0.1:5233/data" > "$(cat ${DDSREM_CONFIG_DIR}/xiaoya_alist_config_dir.txt)"/download_url.txt + echo "http://127.0.0.1:5233/data" > "${CONFIG_DIR}"/download_url.txt else - WARN "程序自动编辑download_url.txt失败,请自行编辑 $(cat ${DDSREM_CONFIG_DIR}/xiaoya_alist_config_dir.txt)/download_url.txt 文件!" + WARN "程序自动编辑download_url.txt失败,请自行编辑 ${CONFIG_DIR}/download_url.txt 文件!" fi if docker inspect xiaoyaliu/alist:latest > /dev/null 2>&1; then