summaryrefslogtreecommitdiffstats
path: root/samba_wizard/scripts/Smbconf.pm
diff options
context:
space:
mode:
Diffstat (limited to 'samba_wizard/scripts/Smbconf.pm')
-rwxr-xr-xsamba_wizard/scripts/Smbconf.pm22
1 files changed, 17 insertions, 5 deletions
diff --git a/samba_wizard/scripts/Smbconf.pm b/samba_wizard/scripts/Smbconf.pm
index 577c1870..62b57ed2 100755
--- a/samba_wizard/scripts/Smbconf.pm
+++ b/samba_wizard/scripts/Smbconf.pm
@@ -3,7 +3,7 @@
package Smbconf;
require "__WIZ_HOME__/common/scripts/Vareqval.pm";
require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm";
-
+use MDK::Common;
use strict;
# All possibilies in the config file must be precedeed by ";"
@@ -22,6 +22,11 @@ sub check {
0;
}
+sub check_services {
+ $ENV{wiz_do_homes} and return 2;
+ 0;
+}
+
sub read_conf {
my ($file) = @_;
my $menu;
@@ -81,14 +86,20 @@ sub chg_var {
$conf{$menu}{$var}{value} = $str;
}
-
sub file_sharing {
- standalone->explanations("Enabling samba file sharing");
- comment_menu("homes", ";");
+ mkdir_p("/home/samba/public");
+ standalone->explanations("Enabling samba /home/samba/public sharing");
+# comment_menu("homes", ";");
comment_menu("public", "");
chg_var("global", "security", "share");
}
+sub homes {
+ standalone->explanations("Enabling samba /home/samba/public sharing");
+ comment_menu("homes", "");
+ chg_var("global", "security", "share");
+}
+
sub printer_sharing {
standalone->explanations("Enabling samba printer sharing");
comment_menu("printers", "");
@@ -104,10 +115,11 @@ sub do_it {
my $ip = $o->get_from_known_dev("IP");
file_sharing() if $ENV{wiz_do_file_sharing};
printer_sharing() if $ENV{wiz_do_printer_sharing};
+ homes() if $ENV{wiz_do_homes};
chg_var("global", "hosts allow", $ip);
chg_var("global", "security", "share");
write_conf("/etc/samba/smb.conf");
- system("/etc/rc.d/init.d/smb restart >/dev/null 2>&1");
+ system("/etc/rc.d/init.d/smb restart");
10;
}
1;