更新diy和通知脚本

This commit is contained in:
whyour 2021-03-20 11:25:51 +08:00
parent 1da99472b4
commit f03323e5d8
5 changed files with 9 additions and 9 deletions

6
shell/git_diy.sh Normal file → Executable file
View File

@ -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

View File

@ -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

View File

@ -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];

2
shell/notify.sh Normal file → Executable file
View File

@ -5,4 +5,4 @@
title=$(echo $1|sed 's/-/_/g')
msg=$(echo -e $2)
node /jd/shell/sendinfo.js "$title" "$msg"
node /jd/shell/notify.js "$title" "$msg"

View File

@ -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();