diff options
Diffstat (limited to 'samba_wizard')
-rwxr-xr-x | samba_wizard/scripts/Smbconf.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/samba_wizard/scripts/Smbconf.pm b/samba_wizard/scripts/Smbconf.pm index 0d2dae10..577c1870 100755 --- a/samba_wizard/scripts/Smbconf.pm +++ b/samba_wizard/scripts/Smbconf.pm @@ -14,6 +14,14 @@ use strict; my %conf; my @tab; +my $o = DrakconnectConf->new(); + +sub check { + $> and return 1; + $o->is_dhcp() and return 2; + 0; +} + sub read_conf { my ($file) = @_; my $menu; @@ -23,7 +31,7 @@ sub read_conf { if (/^(\s*\;?\s*)\[(.*)\].*/) { $menu = $2; $conf{$menu}{__comment} = $1; - } + } elsif (/^(?!\#)(\s*\;*\s*)(.*?)\s*=\s*(.*)\s*$/) { $conf{$menu}{$2}{value} = $3; $conf{$menu}{$2}{comment} = $1; @@ -91,17 +99,9 @@ sub printer_sharing { sub do_it { read_conf("__WIZ_HOME__/samba_wizard/scripts/smb.conf.default"); - 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"; - print $ENV{$_} . "\n"; - } - Vareqval->commit($file, \%mdk); chg_var("global", "workgroup", $ENV{wiz_workgroup}); chg_var("global", "server string", $ENV{wiz_banner}); - my $drakconnect_o = DrakconnectConf->new(); - my $ip = $drakconnect_o->get_from_known_dev("IP"); + my $ip = $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); |