Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- COMMAND_TO_RUN="du /"
- OUT_DATA=$($COMMAND_TO_RUN)
- OUT_RESULT=$?
- if [[ $OUT_RESULT -ne 0 ]]; then
- echo "${OUT_DATA:0:10000}" | head mail -s "Command failed" root@example.com
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement