修复git_pull重复添加任务

This commit is contained in:
whyour
2021-04-04 16:11:35 +08:00
parent 262e43ec10
commit 9f7cd91d39
4 changed files with 4 additions and 6 deletions
-1
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env bash
get_token() {
echo $AuthConf
local authInfo=$(cat $AuthConf)
token=$(get_json_value "$authInfo" "token")
}
+2 -3
View File
@@ -198,7 +198,7 @@ Git_Pull_Scripts_Next() {
Diff_Cron() {
cat $ListCronRemote | grep -E "node.+j[drx]_\w+\.js" | perl -pe "s|.+(j[drx]_\w+)\.js.+|\1|" | sort -u >$ListRemoteTask
cat $ListCronCurrent | grep -E "$ShellJs j[drx]_\w+" | perl -pe "s|.*ID=(.*)$ShellJs (j[drx]_\w+)\.*|\1:\2|" | sort -u >$ListCurrentTask
cat $ListCronCurrent | grep -E "$ShellJs j[drx]_\w+" | perl -pe "s|.*ID=(.*) $ShellJs (j[drx]_\w+)\.*|\2|" | sort -u >$ListCurrentTask
if [ -s $ListCurrentTask ]; then
grep -vwf $ListCurrentTask $ListRemoteTask >$ListJsAdd
else
@@ -218,8 +218,7 @@ Del_Cron() {
echo
JsDrop=$(cat $ListJsDrop)
for Cron in $JsDrop; do
local id=$(echo "$1" | awk -F ":" '{print $1}')
local name=$(echo "$1" | awk -F ":" '{print $2}')
local id=$(cat $ListCronCurrent | grep -E "js $Cron" | perl -pe "s|.*ID=(.*) js $Cron|\1|")
del_cron_api "$id"
done
crontab $ListCronCurrent