[plug] problem with script
Jon Miller
jlmiller at mmtnetworks.com.au
Mon Aug 25 18:10:31 WST 2003
Writing a script to check some processes and I've run into a problem that I cannot figure out. I run the script and get the following:
# ./postfixstatchk.sh
./postfixstatchk.sh: line 37: syntax error near unexpected token `fi'
./postfixstatchk.sh: line 37: `fi'
Script:
#!/bin/bash
# Procedure
# Check status of Postfix and Mail Monitor
# check status first, if equal to 0
# stop MM and Postfix
# restart MM and Postfix
#
#Variables
MTAPATH=/usr/sbin
MTA=postfix
MMPATH=/usr/local/sophos/mmsmtp-1.2.2/Linux-x86/bin
MMSP='mmsmtpd -terminate'
MMST='mmsmtpd -start'
MLSTAT=`pgrep -U postfix`
MMSTAT=`pgrep -u root mmsmtp.out`
#
#
# function to restart MM and postfix
function mmpf()
{
$MTAPATH/$MTA stop
$MMPATH/$MMSP
$MMPATH/$MMST
$MTAPATH/$MTA start
}
# check for existence of data
if [ "$MMSTAT" -lt 1 ]; then
mmpf()
fi <- this is the line where the error takes place
Thanks
Jon
Jon L. Miller, MCNE, CNS
Director/Sr Systems Consultant
MMT Networks Pty Ltd
http://www.mmtnetworks.com.au
"I don't know the key to success, but the key to failure
is trying to please everybody." -Bill Cosby
More information about the plug
mailing list