X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=clearadm%2Fprocessrunning.pl;h=cca1d7c8f1918e256fba33882cc1e0faeb89443a;hb=6e590d0ef541e09c67d19225304d279322ad5112;hp=29c42a372c6129d2f77d64d3c7dd8e8e75844e4b;hpb=020a4a5ea2be725b155cae3a2cadc9aba3911b9b;p=clearscm.git diff --git a/clearadm/processrunning.pl b/clearadm/processrunning.pl index 29c42a3..cca1d7c 100755 --- a/clearadm/processrunning.pl +++ b/clearadm/processrunning.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl =pod @@ -64,7 +64,7 @@ use Utils; my $VERSION = '$Revision: 1.2 $'; ($VERSION) = ($VERSION =~ /\$Revision: (.*) /); -sub restart ($) { +sub restart($) { my ($restart) = @_; my ($status, @output) = Execute "$restart 2>&1"; @@ -72,11 +72,11 @@ sub restart ($) { unless ($status) { display "Successfully executed restart option: $restart"; - display $_ foreach (@output); + display $_ for (@output); } else { display "Unable to restart process using $restart (Status: $status)"; - display $_ foreach (@output); + display $_ for (@output); } # unless return $status; @@ -122,19 +122,15 @@ unless ($status) { . join ("\n", @output), $status; } # if -foreach (@output) { - next - if /grep -i '$name'/; - - next - if /grep -i $name/; - - next - if /$FindBin::Script/; +for (@output) { + next if /grep -i '$name'/; + next if /grep -i $name/; + next if /$FindBin::Script/; display "Found processes named $name"; + exit 0; -} # foreach +} # for display "Did not find any processes named $name"; @@ -170,8 +166,8 @@ L =begin html
-Display
-Utils
+Display
+Utils
=end html @@ -186,4 +182,4 @@ Please report problems to Andrew DeFaria . Copyright (c) 2010, ClearSCM, Inc. All rights reserved. -=cut \ No newline at end of file +=cut