diff --git a/shell/git_diy.sh b/shell/git_diy.sh old mode 100644 new mode 100755 index 25d6027f..643d7ae2 --- a/shell/git_diy.sh +++ b/shell/git_diy.sh @@ -60,7 +60,7 @@ function addnewcron { [ -n "${change}" ] && \cp $js /jd/scripts/${author}_$js && echo -e "${author}_$js 脚本更新了." fi done - [ "$addname" != "" ] notify "新增 ${author} 自定义脚本" "${addname}" + [ "$addname" != "" ] && bash notify "新增 ${author} 自定义脚本" "${addname}" } @@ -74,7 +74,7 @@ function delcron { delname="${delname}\n${author}_${filename}" fi done - [ "$delname" != "" ] && notify "删除 ${author} 失效脚本" "${delname}" + [ "$delname" != "" ] && bash notify "删除 ${author} 失效脚本" "${delname}" } if [[ ${gitpullstatus} -eq 0 ]] @@ -83,7 +83,7 @@ then delcron else echo -e "$author 仓库更新失败了." - notify "自定义仓库更新失败" "$author" + bash notify "自定义仓库更新失败" "$author" fi exit 0 diff --git a/shell/git_pull.sh b/shell/git_pull.sh index b1df24fe..d927a650 100755 --- a/shell/git_pull.sh +++ b/shell/git_pull.sh @@ -263,7 +263,7 @@ function Del_Cron { crontab -l echo -e "\n--------------------------------------------------------------\n" if [ -d ${ScriptsDir}/node_modules ]; then - notify "删除 lxk0301 失效脚本" "${JsDrop}" + bash notify "删除 lxk0301 失效脚本" "${JsDrop}" fi fi } @@ -296,12 +296,12 @@ function Add_Cron { crontab -l echo -e "\n--------------------------------------------------------------\n" if [ -d ${ScriptsDir}/node_modules ]; then - notify "新增 lxk0301 自定义脚本" "${JsAdd}" + bash notify "新增 lxk0301 自定义脚本" "${JsAdd}" fi else echo -e "添加新的定时任务出错,请手动添加...\n" if [ -d ${ScriptsDir}/node_modules ]; then - notify "尝试自动添加 lxk0301 以下新的定时任务出错,请手动添加:" "${JsAdd}" + bash notify "尝试自动添加 lxk0301 以下新的定时任务出错,请手动添加:" "${JsAdd}" fi fi fi diff --git a/shell/notify.js b/shell/notify.js index 4940a29b..47008e7f 100644 --- a/shell/notify.js +++ b/shell/notify.js @@ -1,4 +1,4 @@ -const notify = require('../scripts/sendNotify'); +const notify = require('/jd/scripts/sendNotify'); const title = process.argv[2]; const content = process.argv[3]; diff --git a/shell/notify.sh b/shell/notify.sh old mode 100644 new mode 100755 index f484e140..aa28894b --- a/shell/notify.sh +++ b/shell/notify.sh @@ -5,4 +5,4 @@ title=$(echo $1|sed 's/-/_/g') msg=$(echo -e $2) -node /jd/shell/sendinfo.js "$title" "$msg" \ No newline at end of file +node /jd/shell/notify.js "$title" "$msg" \ No newline at end of file diff --git a/shell/update.js b/shell/update.js index 65e04fd6..e74c71d1 100755 --- a/shell/update.js +++ b/shell/update.js @@ -5,7 +5,7 @@ * @Last Modified time: 2020-12-20 13:51:02 */ const $ = new Env('通知'); -const notify = require('./scripts/sendNotify'); +const notify = require('/jd/scripts/sendNotify'); const fs = require('fs'); !(async () => { await update();