v1.4.1-test

~适配部分没有crontab的梅林设备
This commit is contained in:
juewuy
2021-06-24 23:21:23 +08:00
parent 19fe2f183e
commit 77293e2463
3 changed files with 3 additions and 1 deletions

Binary file not shown.

View File

@@ -1,4 +1,4 @@
clash_v=1.6.0
clashpre_v=2021.05.08
GeoIP_v=20210623
versionsh=1.4.1-test
versionsh=1.4.1-test

View File

@@ -54,6 +54,7 @@ logger(){
[ "$(wc -l $clashdir/log | awk '{print $1}')" -gt 30 ] && sed -i '1,5d' $clashdir/log
}
cronset(){
croncmd(){
if [ -n "$(crontab -h 2>&1 | grep '\-l')" ];then
crontab $1
else
@@ -65,6 +66,7 @@ cronset(){
[ "$1" = "-l" ] && cat $crondir/$USER 2>/dev/null
[ -f "$1" ] && cat $1 > $crondir/$USER
fi
}
# 参数1代表要移除的关键字,参数2代表要添加的任务语句
tmpcron=/tmp/cron_$USER
croncmd -l > $tmpcron