Essa é uma revisão anterior do documento!
echo baixando/instalando os pacotes/arquivos necessarios git clone https://github.com/ccwienk/temper.git apt install python3-serial apt install jq
temperatura=$( /pastatal/temper/temper.py --json | jq --raw-output '.[] ."internal temperature"' ) echo $temperatura maximo=25.0 teste=$(echo "$temperatura < $maximo" | bc) if [ $teste = '1' ]; then echo "temperature $temperaturaºC is smaller than $maximoºC"; else VAR=1; echo 'alert!'; fi if [ "$VAR" == "1" ]; then set smtp=smtps://smtp.grude.ufmg.br:465 set from="sddr@icb.ufmg.br" set smtp-auth-user=icb-smtp set smtp-auth-password=SENHA set smtp-auth=login set smtp-verify=ignore echo "Enviando email..." echo "Tempertura: $temperatura" | /bin/mailx -v -s "[SDDR] Temperatura acima de $maximo graus" gti@icb.ufmg.br echo "Tempertura: $temperatura" | /bin/mailx -v -s "[SDDR] Temperatura acima de $maximo graus" miguel@icb.ufmg.br echo "OK" fi;