# /root/.my.cnf should be configured for mytop with passwd
P=`grep pa /root/.my.cnf |sed -e 's#=# #'|awk '{ print $2 }'`;
while [ 1 ]; do if [ `mysql -uroot -p$P -e"show slave status \G;" | grep "Duplicate entry" | wc -l` -eq 2 ] ; then mysql -uroot -p$P -e"stop slave; set global sql_slave_skip_counter=1; start slave;"; fi; sleep 1; mysql -uroot -p$P -e"show slave status\G"; done
