root 606 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. source /etc/clara.sh
  3. CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')
  4. THRESHOLD=90
  5. if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
  6. if [ ! -f root.txt ]; then
  7. echo> root.txt
  8. echo """
  9. hi
  10. i'm clara. a server Manager bot
  11. Your root partition remaining free space is critically low. Used: $CURRENT%
  12. """ | mutt -s "root partition free space is critically low" $email
  13. fi
  14. else
  15. if [ -e "root.txt" ]; then
  16. rm -Rf root.txt
  17. echo """
  18. hi
  19. i'm clara. a server Manager bot
  20. Your root partition returned to normal sstatuss. Used: $CURRENT%
  21. """ | mutt -s "root partition free space is good" $email
  22. fi
  23. fi