代码拉取完成,页面将自动刷新
#!/bin/bash
trap 'cp /jd-scripts-docker/sync.sh /sync' Exit
(
exec 2<>/dev/null
set -e
cd /jd-scripts-docker
git checkout .
git pull
) || {
git clone https://gitee.com/XanderYe/jd-scripts-docker.git /jd-scripts-docker_tmp
[ -d /jd-scripts-docker_tmp ] && {
rm -rf /jd-scripts-docker
mv /jd-scripts-docker_tmp /jd-scripts-docker
}
}
(
exec 2<>/dev/null
set -e
cd /scripts
git checkout .
git pull
) || {
git clone --branch=master https://gitee.com/XanderYe/jd_scripts.git /scripts_tmp
[ -d /scripts_tmp ] && {
rm -rf /scripts
mv /scripts_tmp /scripts
}
}
(
exec 2<>/dev/null
set -e
cd /loon
git checkout .
git pull
) || {
git clone --branch=main https://gitee.com/XanderYe/Loon.git /loon_tmp
[ -d /loon_tmp ] && {
rm -rf /loon
mv /loon_tmp /loon
}
}
cd /scripts || exit 1
cp /loon/*.js /scripts
npm install || npm install --registry=https://registry.npm.taobao.org || exit 1
[ -f /crontab.list ] && {
cp /crontab.list /crontab.list.old
}
cat /etc/os-release | grep -q ubuntu && {
cp /jd-scripts-docker/crontab.list /crontab.list
crontab -r
} || {
cat /scripts/docker/crontab_list.sh | grep 'node' | sed 's/>>.*$//' | awk '
BEGIN{
print("55 */3 * * * bash /jd-scripts-docker/cron_wrapper bash /sync")
}
{
for(i=1;i<=5;i++)printf("%s ",$i);
printf("bash /jd-scripts-docker/cron_wrapper \"");
for(i=6;i<=NF;i++)printf(" %s", $i);
print "\"";
}
' > /crontab.list
cat /loon/docker/crontab_list.sh | grep 'node' | sed 's/>>.*$//' | awk '
{
for(i=1;i<=5;i++)printf("%s ",$i);
printf("bash /jd-scripts-docker/cron_wrapper \"");
for(i=6;i<=NF;i++)printf(" %s", $i);
print "\"";
}
' >> /crontab.list
cat /custom.list >> /crontab.list
}
crontab /crontab.list || {
cp /crontab.list.old /crontab.list
crontab /crontab.list
}
crontab -l
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。