I get the script working but

I got the script to work.
the write left out the host part.
to fix this you need to answer line to:
answer=`$mysqlpath/mysql -u $user -p$pass -h $host -e ‘show slave statusG’ | /bin/grep Slave_SQL_Running | /usr/bin/cut -f2 -d:`