#!/bin/sh # # $TOOLS/mailto # # Mails text string specified in the $1 parameter to oracle, # otherwise, if the $3 parameter is FILE, mails contents of file specified in # the $1 parameter to oracle # # Optional SUBJECT can be specified in the $2 parameter. # # (NODE-SPECIFIC) # # **** You need to change all occurrences of oracle to your desired mail # recipient. # if [ $# -eq 0 ]; then echo "" | mail oracle else subj="" file="" if [ $# -ge 2 ]; then subj=$2 fi if [ $# -ge 3 ]; then file=$3 fi if [ "$file" != "FILE" ]; then if [ "$subj" != "" ]; then echo "$1" | mailx -s "$2" oracle else echo "$1" | mail oracle fi else if [ -r $1 ]; then if [ "$subj" != "" ]; then cat "$1" | mailx -s "$2" oracle else cat "$1" | mail oracle fi else if [ "$subj" != "" ]; then echo "Error: Trying to mail non-existent"\ "file: $1" | mailx -s "$2" oracle else echo "Error: Trying to mail non-existent"\ "file: $1" | mail oracle fi fi fi fi