Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. COMMAND_TO_RUN="du /"
  4.  
  5. OUT_DATA=$($COMMAND_TO_RUN)
  6. OUT_RESULT=$?
  7.  
  8. if [[ $OUT_RESULT -ne 0 ]]; then
  9. echo "${OUT_DATA:0:10000}" | head mail -s "Command failed" root@example.com
  10. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement