Skip to content

Commit

Permalink
fix: failed to obtain xiaoya path
Browse files Browse the repository at this point in the history
  • Loading branch information
DDSRem committed Apr 30, 2024
1 parent fb3c2df commit 5ce937f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions all_in_one.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5ce937f

Please sign in to comment.