initial commit of file from CVS for smeserver-usbdisksmanager on Sat Sep 7 21:12:12 AEST 2024
This commit is contained in:
27
root/etc/e-smith/db/confusbdisks/migrate/10options
Normal file
27
root/etc/e-smith/db/confusbdisks/migrate/10options
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
my @add = split(/[,; ]+/, '');
|
||||
my %remove = map { $_ => 1 } split(/[,; ]+/, 'managed,pamconsole');
|
||||
# options=pamconsole,exec,noauto,managed,gid=102,uid=101
|
||||
# options=pamconsole,exec,noauto,managed
|
||||
for my $repo ( $DB->get_all )
|
||||
{
|
||||
#warn $repo->key;
|
||||
my @options = split(/,/, $repo->prop('options') || '');
|
||||
push @options, @add;
|
||||
@options = grep(!defined $remove{$_} , @options);
|
||||
|
||||
# remove duplicates
|
||||
undef %saw;
|
||||
@options = grep(!$saw{$_}++, @options);
|
||||
|
||||
if ($#options >= 0)
|
||||
{
|
||||
$repo->set_prop('options', join(',', @options));
|
||||
}
|
||||
else
|
||||
{
|
||||
# $repo->delete('options');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user