lede icon indicating copy to clipboard operation
lede copied to clipboard

各种插件添加/修改删除计划任务crontab文件时可能影响已添加的任务

Open Vibestellar opened this issue 5 years ago • 0 comments

反馈bug/问题模板,提建议请删除

1.关于你要提交的问题

Q:是否搜索了issue (使用 "x" 选择)

  • [x] 没有类似的issue

2. 详细叙述

(1) 具体问题

其实是我习惯不好😂,不知道会不会有小白跟我一样给crontab添加任务的时候没有留下最后的空行 所以在很多插件添加任务的时候,直接追加到自己添加的行了 比如frp里的:

if [ ! -f "/etc/crontabs/root" ] || [ -z "$(cat /etc/crontabs/root | grep frp)" ]; then
  sed -i '/frp/d' /etc/crontabs/root >/dev/null 2>&1
  echo "*/$time * * * * /etc/init.d/frp restart" >> /etc/crontabs/root 
fi

并不会添加空白行

Vibestellar avatar Mar 16 '21 03:03 Vibestellar