#!/bin/sh err=0 agents=$(pcs stonith list 2>&1) if [ $(echo "$agents" | grep -c "fence_virt\|fence_xvm") -ne 2 ]; then echo "ERROR: pcs: fence_virt/fence_xvm not available:\n$agents" err=$((err+1)) else echo "INFO: pcs: fence_virt/fence_xvm available..." fi for bin in "fence_virtd -l"; do output="$($bin 2>&1)" if [ $? -ne 0 ]; then echo -e "ERROR: $bin failed:\n$output" err=$((err+1)) else echo "INFO: $bin works..." fi done if [ $err -ge 1 ]; then echo -e "\nERROR: $err tests FAILED..." exit 1 fi