#!/bin/bash 

set -e

IN=/etc/update-cluster/cluster.xml
OUT=/etc/lam/lam-bhost.def
EX=/usr/bin/update-cluster

if ! [ -e $IN ] ; then
	echo $IN does not exist
	exit 1
fi

if ! [ -e $OUT ] ; then
	echo $OUT does not exist
	exit 1
fi

if ! [ -x $EX ] ; then
	echo $EX does not exist as executable
	exit 1
fi

$EX hostname <$IN >$OUT

exit 0

