Gestion du lancement du script par cron (sans $TERM)

This commit is contained in:
Breizh 2022-10-17 15:57:14 +02:00
parent 601f77f9df
commit 7eb1a9e112
2 changed files with 7 additions and 4 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash -x #!/bin/bash
# Configuration # Configuration
generator=/home/files/scripts/generator.sh generator=/home/files/scripts/generator.sh

View file

@ -9,9 +9,12 @@ webpath="$(echo "${1:-$PWD}" | sed "s#^$root/##g")"
[[ "$webpath" =~ ^$root ]] && unset webpath [[ "$webpath" =~ ^$root ]] && unset webpath
# Couleur de logs juste parce que c'est joli # Couleur de logs juste parce que c'est joli
blue=$(tput setaf 4) if [[ -n "$TERM" ]]
green=$(tput setaf 2) then
reset=$(tput sgr0) blue=$(tput setaf 4)
green=$(tput setaf 2)
reset=$(tput sgr0)
fi
# Annonce du début du traitement # Annonce du début du traitement
echo "${blue}Start${reset} /$webpath" echo "${blue}Start${reset} /$webpath"