|
|
|
@ -530,12 +530,14 @@ echo "-------------------------------------------------------------------------- |
|
|
|
|
file = '/etc/crontab' |
|
|
|
|
elif sys_name.startswith("freebsd"): |
|
|
|
|
file = '/var/cron/tabs/root' |
|
|
|
|
elif sys_name.startswith("ubuntu"): |
|
|
|
|
file = '/var/spool/cron/root' |
|
|
|
|
# elif sys_name.startswith("ubuntu"): |
|
|
|
|
# file = '/var/spool/cron/root' |
|
|
|
|
|
|
|
|
|
if not os.path.exists(file): |
|
|
|
|
mw.writeFile(file, '') |
|
|
|
|
content = mw.readFile(file) |
|
|
|
|
if not content: |
|
|
|
|
content == '' |
|
|
|
|
# if not content: |
|
|
|
|
# return mw.returnData(False, '计划任务配置文件不存在?') |
|
|
|
|
content += str(bash_script) + "\n" |
|
|
|
|