diff --git a/sample/test.js b/sample/test.js new file mode 100644 index 00000000..8762eadc --- /dev/null +++ b/sample/test.js @@ -0,0 +1,8 @@ +/** + * 任务名称 + * name: script name + * 定时规则 + * cron: 1 9 * * * + */ + +console.log('test scripts'); diff --git a/sample/test.py b/sample/test.py new file mode 100644 index 00000000..3866305a --- /dev/null +++ b/sample/test.py @@ -0,0 +1,8 @@ +""" +任务名称 +name: script name +定时规则 +cron: 1 9 * * * +""" + +print("test script") diff --git a/shell/share.sh b/shell/share.sh index c66435e9..96569004 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -33,8 +33,12 @@ file_task_sample=$dir_sample/task.sample.sh file_extra_sample=$dir_sample/extra.sample.sh file_notify_js_sample=$dir_sample/notify.js file_notify_py_sample=$dir_sample/notify.py +file_test_js_sample=$dir_sample/test.js +file_test_py_sample=$dir_sample/test.py file_notify_py=$dir_scripts/notify.py file_notify_js=$dir_scripts/sendNotify.js +file_test_js=$dir_scripts/test.js +file_test_py=$dir_scripts/test.py nginx_app_conf=$dir_root/docker/front.conf nginx_conf=$dir_root/docker/nginx.conf dep_notify_py=$dir_dep/notify.py @@ -234,6 +238,16 @@ fix_config() { echo fi + if [[ ! -s $file_test_js ]]; then + cp -fv $file_test_js_sample $file_test_js + echo + fi + + if [[ ! -s $file_test_py ]]; then + cp -fv $file_test_py_sample $file_test_py + echo + fi + if [[ -s /etc/nginx/conf.d/default.conf ]]; then echo -e "检测到默认nginx配置文件,清空...\n" cat /dev/null >/etc/nginx/conf.d/default.conf