You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
820 B

  1. #!/bin/bash
  2. subject="Rapport Licence ZxSuite"
  3. body="Bonjour,"
  4. body2="Vous tourverez ci-dessous le rapport sur l'utilisation des Licences ZxChat:"
  5. body3=`su - zimbra -c "zxsuite core getLicenseInfo"`
  6. body4="erreur dans la génération du rapport Zimbra"
  7. from="noc@altinea.fr"
  8. to="aline@commeo.eu"
  9. to2="support@altinea.fr"
  10. c1="sebastien.faton@altinea.fr"
  11. su - zimbra -c "zxsuite core getLicenseInfo"
  12. VERIF_RCODE=$(su - zimbra -c"echo $?")
  13. if [ $VERIF_RCODE -eq 1 ]; then
  14. echo -e "Subject:${subject}\n${body}\n\n${body4}" | sendmail -F "Altinea Mail server 2" -f "${from}" -t "${to2}" -c "${c1}"
  15. exit 1;
  16. fi
  17. if [ $VERIF_RCODE -eq 0 ]; then
  18. echo -e "Subject:${subject}\n${body}\n\n${body2}\n${body3}" | sendmail -F "Altinea Mail server 2" -f "${from}" -t "${to}" -c "${c1}"
  19. exit 1;
  20. fi