#!/bin/sh
#
# ex2
# BIG BROTHER EXAMPLE 2 PAGER SCRIPT FOR NON STANDARD RECIPIENT
# Robert-Andre Croteau - BB4 Technologies Inc.
# Version 1.6
# Nov 23th, 2000
#
# This program is Copyright (c) 1997-2002
# BB4 Technologies Inc.
# All Rights Reserved
#
# Usage: ex2
#

# The following variables are available thru the environment
# 
# BBALPHAMSG - Default message defined 
# ACKCODE - Notification associated ack code
# BBHOSTSVC - host in www.xxx.com.disk format
# BBHOSTSVCCOMMAS - host in www,xxx,com.disk format
# RCPT - recipient 
# MACHIP - IP address of host in normalized 12 digits AAABBBCCCDDD
# BBSVCNAME - name of service
# BBSVCNUM - numeric equivalent of service (from svcerrlist in bbwarnsetup.cfg)
# BBNUMERIC - ${MACHIP}${BBSVCNUM}
# BBCOLORLEVEL - Color level 
# DOWNSECSVMSG- Default recovery message
# DOWNSECS - # of seconds to recovery
# RECOVERED - 1 in recovery mode, anything else non-recovery mode

#
# The RCPT value contains the real recipient value.  It was
# stripped of its ext-XXX- prefix (where XXX is what you called
# your notification script, in this example it would be ext-ex2-<recipient>)
#

if [ "$BBTMP" = "" ]
then
	echo "BB environment not set !!!"
	exit 1
fi

#
# Send a shortened message to mail recipient
#

echo "!BB - ${ACKCODE}! $BBHOSTSVC - $BBNUMERIC" | $MAIL "BB" "$RCPT"

exit 0
