From b90c525b28bcbc65201b049161b3aab1566e6886 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Fri, 28 Mar 2008 15:38:36 +0000 Subject: add check_starts_on_boot function --- common/Wizcommon.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/Wizcommon.pm b/common/Wizcommon.pm index 43971713..7e58107a 100644 --- a/common/Wizcommon.pm +++ b/common/Wizcommon.pm @@ -27,7 +27,7 @@ use MDK::Common; use MDK::Wizard::IFCFG; our @ISA = qw(Exporter); -our @EXPORT = qw(check_started test_host_domain); +our @EXPORT = qw(check_started check_starts_on_boot test_host_domain); my $net; @@ -51,6 +51,16 @@ sub check_started { } } +sub check_starts_on_boot($$) { + my ($in, $servicename) = @_; + if (!services::starts_on_boot($servicename)) { + my $start_service = $in->ask_yesorno(N("Start %s server on boot", $servicename), N("Would you like to start the %s service automatically on every boot?", $servicename), 1); + if ($start_service) { + services::start_service_on_boot($servicename); + } + } +} + sub test_host_domain { my ($SHORTHOSTNAME, $DOMAINNAME) = @_; if ($SHORTHOSTNAME =~ /localhost/) { -- cgit v1.2.1