On 04/09/12 11:28 -0500, Steve Linabery wrote:
Made the script exit with 1 if a service is detected as not running. --- bin/aeolus-check-services | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)diff --git a/bin/aeolus-check-services b/bin/aeolus-check-services index 27013c2..eb35550 100755 --- a/bin/aeolus-check-services +++ b/bin/aeolus-check-services @@ -29,6 +29,7 @@ end # ordered as in rc.d init_scripts=%w(mongod iwhd postgresql httpd deltacloud-core libvirtd aeolus-conductor conductor-delayed_job conductor-dbomatic imagefactory ntpd) +exit_status = 0 init_scripts.each do |script| puts "\nChecking #{script} ..." cmd = "service #{script} status" @@ -36,6 +37,8 @@ init_scripts.each do |script| if $?.to_i == 0 puts " \e[1;32mSuccess:\e[0m #{out.strip}" else + exit_status = 1 puts " \e[1;31mFAILURE:\e[0m #{out.strip}" end end +exit(exit_status) -- 1.7.7.6
ACK, properly outputs failures. -j
