summaryrefslogtreecommitdiff
path: root/scripts/mail-logger.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mail-logger.sh')
-rwxr-xr-xscripts/mail-logger.sh29
1 files changed, 0 insertions, 29 deletions
diff --git a/scripts/mail-logger.sh b/scripts/mail-logger.sh
deleted file mode 100755
index 5734a28..0000000
--- a/scripts/mail-logger.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-# Script mailer
-
-if [ "$1" = "" -o "$2" = "" ] ; then
- echo "Usage"
- echo "$0 <mailto> <script> [<script_args> ...]"
- exit 1
-fi
-
-MAILTO="$1";
-BASE="/tmp/$$"
-LOGO="${BASE}o";
-LOGE="${BASE}e";
-SCRIPT="${BASE}s";
-shift;
-
-# Execute the script
-echo "$@" > "${SCRIPT}";
-chmod +x "${SCRIPT}"
-"${SCRIPT}" > "${LOGO}" 2> "${LOGE}";
-
-if [ -s "${LOGE}" ] ; then
- mailx -s "Errors from ${1}" "${MAILTO}" < "${LOGE}";
-fi
-if [ -s "${LOGO}" ] ; then
- mailx -s "Output from ${1}" "${MAILTO}" < "${LOGO}";
-fi
-rm "${LOGO}" "${LOGE}" "${SCRIPT}"
-
-