#!/bin/sh
#
# an example of calling moncmd in batch mode
#
# $Id: batch-example,v 1.1.1.1 2004/06/09 05:18:07 trockij Exp $
#
trap "stty echo && echo && exit" 2

echo -n "Password: "
stty -echo
read p
echo
stty echo

cat <<EOF | moncmd -a
USER=monuser
PASS=$p
list failures
enable host xyz
EOF
