修复git_pull生成crontab

This commit is contained in:
whyour 2021-03-26 10:32:44 +08:00
parent 4f1376e750
commit 9fd678a7fc

View File

@ -69,7 +69,6 @@ function Git_PullShell {
function Git_PullShellNext {
if [[ ${ExitStatusShell} -eq 0 ]]; then
echo -e "更新shell成功...\n"
Update_Entrypoint
[[ "${PanelDependOld}" != "${PanelDependNew}" ]] && cd ${ShellDir}/panel && Npm_Install panel
cp -f ${FileConfSample} ${ConfigDir}/config.sh.sample
[ -d ${ScriptsDir}/node_modules ] && Notify_Version
@ -102,14 +101,6 @@ function Git_PullScripts {
git reset --mixed
}
## 更新docker-entrypoint
function Update_Entrypoint {
if [[ ${QL_DIR} ]] && [[ $(cat ${ShellDir}/docker/docker-entrypoint.sh) != $(cat /usr/local/bin/docker-entrypoint.sh) ]]; then
cp -f ${ShellDir}/docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
chmod 777 /usr/local/bin/docker-entrypoint.sh
fi
}
## 检测文件LXK9301/jd_scripts 仓库中的 docker/crontab_list.sh
## 检测定时任务是否有变化此函数会在Log文件夹下生成四个文件分别为
## task.list crontab.list中的所有任务清单仅保留脚本名
@ -256,7 +247,7 @@ function Add_Cron {
then
echo "4 0,9 * * * ${ShellJs} ${Cron}" >> ${ListCron}
else
cat ${ListCronLxk} | grep -E "\/${Cron}\." | perl -pe "s|(^.+)node */scripts/(j[drx]_\w+)\.js.+|\${ShellJs} \2|" >> ${ListCron}
cat ${ListCronLxk} | grep -E "\/${Cron}\." | perl -pe "s|(^.+)node */scripts/(j[drx]_\w+)\.js.+|\1${ShellJs} \2|" >> ${ListCron}
fi
done