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
generator=/home/files/scripts/generator.sh

View File

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