summaryrefslogtreecommitdiffstats
path: root/samba_wizard/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'samba_wizard/scripts')
-rwxr-xr-xsamba_wizard/scripts/Smbconf.pm13
1 files changed, 6 insertions, 7 deletions
diff --git a/samba_wizard/scripts/Smbconf.pm b/samba_wizard/scripts/Smbconf.pm
index 264798e8..0d2dae10 100755
--- a/samba_wizard/scripts/Smbconf.pm
+++ b/samba_wizard/scripts/Smbconf.pm
@@ -2,6 +2,7 @@
package Smbconf;
require "__WIZ_HOME__/common/scripts/Vareqval.pm";
+require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm";
use strict;
@@ -74,24 +75,23 @@ sub chg_var {
sub file_sharing {
- standalone::explanations("Enabling samba file sharing");
+ standalone->explanations("Enabling samba file sharing");
comment_menu("homes", ";");
comment_menu("public", "");
chg_var("global", "security", "share");
}
sub printer_sharing {
- standalone::explanations("Enabling samba printer sharing");
+ standalone->explanations("Enabling samba printer sharing");
comment_menu("printers", "");
}
# remember one variable cannot be commented and not in the same file.
sub do_it {
- my ($file, $device, $ip);
read_conf("__WIZ_HOME__/samba_wizard/scripts/smb.conf.default");
- $file = "/etc/sysconfig/mdk_serv";
+ my $file = "/etc/sysconfig/mdk_serv";
my %mdk = Vareqval->get($file);
foreach (qw(wiz_banner wiz_workgroup wiz_do_printer_sharing wiz_do_file_sharing)) {
$mdk{$_} = $ENV{$_} if defined $ENV{$_} or die "$_ not in env";
@@ -100,9 +100,8 @@ sub do_it {
Vareqval->commit($file, \%mdk);
chg_var("global", "workgroup", $ENV{wiz_workgroup});
chg_var("global", "server string", $ENV{wiz_banner});
- $device = $mdk{wiz_device};
- my %mdk = Vareqval->get("/etc/sysconfig/network-scripts/ifcfg-".$device);
- $ip = $mdk{IPADDR};
+ my $drakconnect_o = DrakconnectConf->new();
+ my $ip = $drakconnect_o->get_from_known_dev("IP");
file_sharing() if $ENV{wiz_do_file_sharing};
printer_sharing() if $ENV{wiz_do_printer_sharing};
chg_var("global", "hosts allow", $ip);