-../../index/zebraidx -c $pp/zebra.cfg -l$LOG init
-../../index/zebraidx -c $pp/zebra.cfg -l$LOG update records/*marc
+
+if ../../index/zebraidx -c $pp/zebra.cfg -l $LOG filters|grep grs.marc >/dev/null; then
+ ../../index/zebraidx -c $pp/zebra.cfg -l$LOG init
+else
+ exit 0
+fi
+
+if grep 'UTF-8 to koi8-r unsupported' $LOG >/dev/null; then
+ exit 0
+fi
+../../index/zebraidx -c $pp/zebra.cfg -l$LOG update $pp/records/*marc