summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/Wizcommon.pm12
-rwxr-xr-xproxy_wizard/Squid.pm7
-rwxr-xr-xweb_wizard/Apache.pm7
3 files changed, 13 insertions, 13 deletions
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/) {
diff --git a/proxy_wizard/Squid.pm b/proxy_wizard/Squid.pm
index d47c86e2..1188ddcc 100755
--- a/proxy_wizard/Squid.pm
+++ b/proxy_wizard/Squid.pm
@@ -233,12 +233,7 @@ sub port {
sub do_it {
$::testing and return;
my $in = 'interactive'->vnew('su', 'Squid Config');
- if (!services::starts_on_boot('squid')) {
- my $start_service = $in->ask_yesorno(N("Start %s server on boot", "squid"), N("Would you like to start the %s service automatically on every boot?", "squid"), 1);
- if ($start_service) {
- services::start_service_on_boot('squid');
- }
- }
+ check_starts_on_boot($in, 'squid');
my $w = $in->wait_message(N("Squid proxy"), N("Configuring your system as a Proxy server..."));
my $file="/etc/squid/squid.conf";
-f $file and MDK::Common::cp_af($file, $file.".orig");
diff --git a/web_wizard/Apache.pm b/web_wizard/Apache.pm
index b35905a7..6e1972ac 100755
--- a/web_wizard/Apache.pm
+++ b/web_wizard/Apache.pm
@@ -248,12 +248,7 @@ EOF
sub do_it {
$::testing and return;
my $in = 'interactive'->vnew('su', 'Apache');
- if (!services::starts_on_boot('httpd')) {
- my $start_service = $in->ask_yesorno(N("Start %s server on boot", "httpd"), N("Would you like to start the %s service automatically on every boot?", "httpd"), 1);
- if ($start_service) {
- services::start_service_on_boot('httpd');
- }
- }
+ check_starts_on_boot($in, 'httpd');
my $w = $in->wait_message(N("Apache server"), N("Configuring your system as Apache server ..."));
my $that = "localhost";