兼容Debian系统

This commit is contained in:
tumi 2023-02-22 13:00:28 +08:00
parent e05b0a2491
commit a188134894
2 changed files with 7 additions and 2 deletions

View File

@ -468,7 +468,8 @@ export default class CronService {
private async set_crontab() {
const tabs = await this.crontabs();
var crontab_string = '';
var crontab_string = `SHELL=${process.env.SHELL}\n`;
crontab_string += `PATH=${process.env.PATH}\n`;
tabs.data.forEach((tab) => {
const _schedule = tab.schedule && tab.schedule.split(/ +/);
if (tab.isDisabled === 1 || _schedule!.length !== 5) {

View File

@ -57,6 +57,10 @@ echo -e "容器启动成功..."
echo -e "\n请先访问5700端口登录成功面板之后再执行添加定时任务..."
echo -e "############################################################\n"
crond -f >/dev/null
if [ -x "$(command -v crond)" ]; then
crond -f >/dev/null
elif [ -x "$(command -v cron)" ]; then
cron -f >/dev/null
fi
exec "$@"