afficher quand la planification est désactivée

This commit is contained in:
Jephté Clain 2015-02-11 09:30:28 +04:00
parent 7f426a74b0
commit 33465d757d
1 changed files with 7 additions and 1 deletions

View File

@ -369,12 +369,18 @@ elif [ "$action" == "list" ]; then
ctfiles=("$uscrontab") ctfiles=("$uscrontab")
fi fi
else else
array_from_lines ctfiles "$(crontab -l 2>/dev/null | awkrun script="$script" '$6 == script { if ($7) print $7; else print "GENERIC" }')" array_from_lines ctfiles "$(crontab -l 2>/dev/null | awkrun script="$script" '$6 == script { if ($7) print $7; else if ($0 ~ /^#/) print "#GENERIC"; else print "GENERIC" }')" #'
if array_contains ctfiles "GENERIC"; then if array_contains ctfiles "GENERIC"; then
# il y a une planification générique # il y a une planification générique
array_del ctfiles "GENERIC" array_del ctfiles "GENERIC"
set_usercrontabs usercrontabs set_usercrontabs usercrontabs
array_extend ctfiles usercrontabs array_extend ctfiles usercrontabs
elif array_contains ctfiles "#GENERIC"; then
# il y a une planification générique désactivée
array_del ctfiles "#GENERIC"
set_usercrontabs usercrontabs
array_extend ctfiles usercrontabs
ewarn "planification générique désactivée. Vous pouvez la réactiver avec $scriptname -A"
elif [ ${#ctfiles[*]} -eq 0 ]; then elif [ ${#ctfiles[*]} -eq 0 ]; then
einfo "aucune planification en cours" einfo "aucune planification en cours"
set_usercrontabs ctfiles set_usercrontabs ctfiles