mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:49:25 +08:00
Update crontab.py
This commit is contained in:
@@ -526,15 +526,11 @@ echo "--------------------------------------------------------------------------
|
||||
elif sys_os.startswith("freebsd"):
|
||||
file = '/var/cron/tabs/root'
|
||||
|
||||
if not os.path.exists(file):
|
||||
file = '/var/spool/cron/root'
|
||||
|
||||
if not os.path.exists(file):
|
||||
mw.writeFile(file, '')
|
||||
|
||||
content = mw.readFile(file)
|
||||
if not content:
|
||||
return mw.returnData(False, '计划任务配置文件不存在?')
|
||||
# if not content:
|
||||
# return mw.returnData(False, '计划任务配置文件不存在?')
|
||||
content += str(bash_script) + "\n"
|
||||
if mw.writeFile(file, content):
|
||||
if not os.path.exists(file):
|
||||
|
||||
Reference in New Issue
Block a user