Learning something new is great. Joe Geiger taught me something cool that I should have learned years ago.
Serviceguard users ever wanted to script a cluster change such as a node add.
cmapplyconf -v -P <package file>
Ends with a y/n prompt do you want to apply? Normally that requires input. Not with the yes command:
cmcheckconf -v -P <package file>
rc=$?
# Check return code if not zero stop
if [ ${rc} -ne 0 ]
then
echo “Checkconf error ${rc}”
exit ${rc}
fi
yes | cmapplyconf -v -P <package file>
# Check return code here as well
Tags: automation, HP-UX, scripting, serviceguard, yes command