From a6ba85f1a4eb5491b6c6a692f49c216e95215686 Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Fri, 6 Feb 2004 11:51:25 +0000 Subject: add check_started to check if service has been started or not --- common/Wizcommon.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/Wizcommon.pm b/common/Wizcommon.pm index 881c2553..aa53865c 100644 --- a/common/Wizcommon.pm +++ b/common/Wizcommon.pm @@ -20,8 +20,12 @@ package MDK::Wizard::Wizcommon; use strict; +use MDK::Common; use MDK::Wizard::IFCFG; +our @ISA = qw(Exporter); +our @EXPORT = qw(check_started); + my $net; sub check_dhcp { @@ -36,4 +40,12 @@ sub new { }, $class; } +sub check_started { + my ($service) = @_; + my ($isrunning) = chomp_(`pidof $service`) =~ /(\d+)/m; + if (!$isrunning) { + return 'error_end' + } +} + 1 -- cgit v1.2.1