Giter VIP home page Giter VIP logo

Comments (9)

SuperNG6 avatar SuperNG6 commented on July 27, 2024

我觉得没有问题吧,如果无法执行,大概是因为权限问题,readme里的文档有写

#!/bin/bash

downloadpath='/downloads'

filepath=$3
rdp=${filepath#${downloadpath}/}
path=${downloadpath}/${rdp%%/*}

if [ $2 -eq 0 ]
    then
        exit 0
elif [ "$path" = "$filepath" ] && [ $2 -eq 1 ]
    then
    [ -e "$filepath".aria2 ] && rm -vf "$filepath".aria2
    exit 0
elif [ "$path" != "$filepath" ] && [ $2 -gt 1 ]
    then
    [ -e "$path".aria2 ] && rm -vf "$path".aria2
    exit 0
elif [ "$path" != "$filepath" ] && [ $2 -eq 1 ]
    then
    [ -e "$filepath".aria2 ] && rm -vf "$filepath".aria2
    exit 0
fi

from docker-aria2.

zlx42 avatar zlx42 commented on July 27, 2024

新版本好像还是不行,我改成这样就可以

#!/bin/bash

downloadpath='/downloads'
filepath=$3
rdp=${filepath#${downloadpath}/}
path=${downloadpath}/${rdp%%/*}

if [ $2 -eq 0 ]
    then
        exit 0
elif [ "$path" = "$filepath" ] && [ $2 -eq 1 ]
    then
    path2=${path%.*}
    [ -e "$path2".aria2 ] && rm -f "$path2".aria2 
    exit 0
elif [ "$path" != "$filepath" ] && [ $2 -gt 1 ]
    then
    path3=${path%.*}
    [ -e "$path3".aria2 ] && rm -f "$path3".aria2
    exit 0
elif [ "$path" != "$filepath" ] && [ $2 -eq 1 ]
    then
    path4=${path%.*}
    [ -e "$path4".aria2 ] && rm -f "$path4".aria2
    exit 0
fi

from docker-aria2.

SuperNG6 avatar SuperNG6 commented on July 27, 2024

今天抽时间研究了一下aria2的参数传递,更新了删除文件的脚本,经过测试删除功能正常运行,删除功能已完善

from docker-aria2.

zlx42 avatar zlx42 commented on July 27, 2024

我在群晖里面还是不行,$3是带有扩展名的~你的这个删除时有扩展名就出错

from docker-aria2.

SuperNG6 avatar SuperNG6 commented on July 27, 2024

from docker-aria2.

SuperNG6 avatar SuperNG6 commented on July 27, 2024

我的建议是你删除容器,重新建一个,脚本估计是因为你修改过所以没被替换
你可以进容器 cat /aria2/script/delete.sh 看一下是否是新的脚本

from docker-aria2.

zlx42 avatar zlx42 commented on July 27, 2024

容器更新过了,我容器看过了,是最新的脚本。
后来不行,我自定义的脚本也换成你的最新版了。结果还是不行

我用echo [$(date)] $filepath "
" >> /config/_log.html输出记录的是
/downloads/abcd/abcd.mp4之类的,

[Wed Feb 26 19:19:33 CST 2020] m1 , /downloads/trackers_all.txt

[Wed Feb 26 20:59:41 CST 2020] m3 , /downloads/abcd.mp4

但是.aria2文件是/downloads/abcd.aria2
感觉应该是你的filepath直接用的$3,是带扩展名的,你的脚本目前只有dirpath是正确的,其他的只要用[ -e "$filepath".aria2 ] && rm -vf "$filepath".aria2都会变成/downloads/abcd/abcd.mp4.aria2这样的就删除失败了。。。。

#!/bin/bash

downloadpath='/downloads'

filepath=$3
rdp=${filepath#${downloadpath}/}
path=${downloadpath}/${rdp%%/}
dirpath=${filepath%/
}

if [ $2 -eq 0 ]
then
exit 0
elif [ "$path" = "$filepath" ] && [ $2 -eq 1 ]
then
[ -e "$filepath".aria2 ] && rm -vf "$filepath".aria2
echo [$(date)] m1 , $filepath "
" >> /config/_log.html

exit 0
elif [ "$path" != "$filepath" ] && [ $2 -gt 1 ]
then
[ -e "$dirpath".aria2 ] && rm -vf "$dirpath".aria2
echo [$(date)] m2 , $dirpath "
" >> /config/_log.html

exit 0
elif [ "$path" != "$filepath" ] && [ $2 -eq 1 ]
then
[ -e "$dirpath".aria2 ] && rm -vf "$filepath".aria2
echo [$(date)] m1 ,$dirpath "
" >> /config/_log.html
exit 0

from docker-aria2.

SuperNG6 avatar SuperNG6 commented on July 27, 2024

from docker-aria2.

zlx42 avatar zlx42 commented on July 27, 2024

都说了按输出的记录显示filepath内容使用扩展名的,你用dirpath之类的都是对的,但是用filepath输出的都带扩展名。

[Wed Feb 26 19:19:33 CST 2020] m1 , /downloads/trackers_all.txt

"$filepath" 的内容是 /downloads/abcd.mp4 ,所以命令输出就会变成/downloads/abcd.mp4.aria2
是不是DSM6.22这个群晖系统有问题??

from docker-aria2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.