-#!/usr/bin/perl
+#!/usr/bin/env perl
=pod
my $VERSION = '$Revision: 1.2 $';
($VERSION) = ($VERSION =~ /\$Revision: (.*) /);
-sub restart ($) {\r
+sub restart($) {\r
my ($restart) = @_;
my ($status, @output) = Execute "$restart 2>&1";
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;
. 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";
Copyright (c) 2010, ClearSCM, Inc. All rights reserved.
-=cut
\ No newline at end of file
+=cut