#!/usr/bin/awk -f # reduce the providers list to heartbeat and pacemaker # (prevents other providers creeping in) function reduce(a) { a["heartbeat"]=1; a["pacemaker"]=1; s=""; for( i=1; i<=NF; i++ ) if( $i in a ) s=s" "$i; return substr(s,2); } n==1 { n=0; print reduce(a); next; } /providers IPaddr/ { n=1; } /providers Dummy/ { n=1; } /^ssh STONITH/ { sub(" external",""); } { print }