代码拉取完成,页面将自动刷新
repo=https://raw.githubusercontent.com/shylocks/Loon/main
# Loon
loon=./loon/shylocks_LoonTask.conf
rm $loon
echo "hostname = api.m.jd.com, wq.jd.com\n" >>$loon
for file in $(ls | grep jd_ $1); do
test=$(cat $file | grep 'cron.*script-path=.*tag=.*')
test2=$(cat $file | grep 'http-request.*tag=.*script-path=.*')
if [ -n "$test" ]; then
var=$(cat $file | grep -oEi 'new Env(.*)')
var=${var#*Env\(\'}
var='# '${var%\'*}
echo $var >>$loon
if [ -n "$test2" ]; then
echo $test2 >>$loon
fi
echo $test"\n" >>$loon
fi
done
git add $loon
# Quantumultx
qx=./quantumultx/shylocks_gallery.json
rm $qx
echo "{" >>$qx
echo ' "name": "shylocks task gallery",' >>$qx
echo ' "description": "https://github.com/shylocks/Loon",' >>$qx
echo ' "task": [' >>$qx
for file in $(ls | grep jd_ $1); do
task=$(cat $file | grep 'tag=.*img-url=.*,')
if [ -n "$task" ]; then
str=' {\n "config": "'$task'"'
re=$(cat $file | grep '.*script-request-header.*')
if [ -n "$re" ]; then
str=$str','
echo $str >>$qx
rm "./quantumultx/${file%.*}.qxrewrite"
echo $(cat $file | grep 'hostname = .*')"\n" >>"./quantumultx/${file%.*}.qxrewrite"
echo $re >>"./quantumultx/${file%.*}.qxrewrite"
git add "./quantumultx/${file%.*}.qxrewrite"
echo ' "addons": "'$repo'/quantumultx/'${file%.*}'.qxrewrite, tag='${file%.*}'_COOKIE"' >>$qx
else
echo $str >>$qx
fi
echo ' },' >>$qx
fi
done
echo ' ]\n}' >>$qx
git add $qx
# Surge
surge=./surge/shylocks_Task.sgmodule.sgmodule
rm $surge
echo "#!name=shylocks iOS Tasks Module" >>$surge
echo "#!desc=iOS Tasks 模块配置" >>$surge
echo '[Script]' >>$surge
for file in $(ls | grep jd_ $1); do
task=$(cat $file | grep 'type=cron.*wake-system.*,')
if [ -n "$task" ]; then
echo $task >>$surge
fi
done
git add $surge
# docker
docker=./docker/crontab_list.sh
rm $docker
for file in $(ls | grep jd_ $1); do
task=$(cat $file | grep 'tag=.*img-url=.*,')
if [ -n "$task" ]; then
var=$(cat $file | grep -oEi 'new Env(.*)')
var=${var#*Env\(\'}
var='# '${var%\'*}
echo $var >> $docker
cron=$(cat $file | grep 'cron ".*" s')
cron=${cron#*cron \"}
cron=${cron%\"*}
echo $cron' node /scripts/'${file%.*}'.js >> /scripts/logs/'${file%.*}'.log 2>&1' >> $docker
echo >> $docker
fi
done
git add $docker
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。