#!/bin/bash cd /var/www/html/rrd || exit 1 output=$(ruby /nwp/bin/iwg_watch.rb) if [ -n "$output" ]; then { echo "From: news" echo "To: news" echo "Subject: IWG Watch Alert" echo printf '%s\n' "$output" } | /usr/sbin/sendmail -t fi