diff options
| author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-27 23:10:53 +0200 |
|---|---|---|
| committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-27 23:10:53 +0200 |
| commit | 9ae1cd8f91aa6b53404e66588679d852d3972bcd (patch) | |
| tree | 1edc8a9ac8e36bf8fabeed7b7b3ad933d691438c /tools/mail_error | |
| parent | 983d10e0609175a26675a97129b9e7def18d5f35 (diff) | |
| download | monitoring-plugins-9ae1cd8f91aa6b53404e66588679d852d3972bcd.tar.gz | |
tools: Remove Drupal/SourceForge scripts
We moved our web site away from Drupal and the snapshots/guidelines away
from SourceForge. The new infrastructure scripts will be maintained in
a separate repository together with the Markdown source of the new web
site.
Diffstat (limited to 'tools/mail_error')
| -rwxr-xr-x | tools/mail_error | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/tools/mail_error b/tools/mail_error deleted file mode 100755 index aabb579c..00000000 --- a/tools/mail_error +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # mail_error -o file -m email_address command | ||
| 3 | # Runs command from cron and redirects all output to file | ||
| 4 | # If command rc != 0, sends output to email_address | ||
| 5 | |||
| 6 | function die { echo $1 ; exit 1; } | ||
| 7 | |||
| 8 | # Must be export so that sfsnapshot uses correct versions | ||
| 9 | # of GNU toolchain | ||
| 10 | export PATH=$HOME/bin:$HOME/local/bin:$PATH | ||
| 11 | |||
| 12 | while getopts "o:m:" c; do | ||
| 13 | case $c in | ||
| 14 | o) output_file=$OPTARG;; | ||
| 15 | m) email=$OPTARG;; | ||
| 16 | \*) echo "oops";; | ||
| 17 | esac | ||
| 18 | done | ||
| 19 | shift $(($OPTIND-1)) | ||
| 20 | |||
| 21 | [[ -z $1 ]] && die "Must specify command" | ||
| 22 | |||
| 23 | if ! "$@" > $output_file 2>&1 ; then | ||
| 24 | mail -s "mail_error fail: $1" $email < $output_file | ||
| 25 | fi | ||
