sub set_shares { my ($smb_conf_file, $shares) = @_; my (@sections, $section, $share); # Get the sections. @sections = &Utils::Parse::get_ini_sections ($smb_conf_file); # remove deleted sections foreach $section (@sections) { #next if ($section =~ /^(global)|(homes)|(printers)|(print\$)$/); #next if (&Utils::Parse::get_from_ini_bool ($smb_conf_file, $section, "printable")); if (!&smb_table_find ($section, $shares)) { Utils::Replace::remove_ini_section ($smb_conf_file, $section); } } for $share (@$shares) { &set_share_info ($smb_conf_file, $share); } }