5 require './webmin-lib.pl';
8 &lock_file("$config_directory/config");
10 # Automatically detect
11 %osinfo = &detect_operating_system();
12 $gconfig{'real_os_type'} = $osinfo{'real_os_type'};
13 $gconfig{'real_os_version'} = $osinfo{'real_os_version'};
14 $gconfig{'os_type'} = $osinfo{'os_type'};
15 $gconfig{'os_version'} = $osinfo{'os_version'};
17 elsif ($in{'type'} ne $gconfig{'real_os_type'} ||
18 $in{'version'} ne $gconfig{'real_os_version'} ||
19 $in{'itype'} ne $gconfig{'os_type'} ||
20 $in{'iversion'} ne $gconfig{'os_version'}) {
22 $gconfig{'real_os_type'} = $in{'type'};
23 $in{'version'} || &error($text{'os_eversion'});
24 $gconfig{'real_os_version'} = $in{'version'};
25 ($os) = grep { $_->{'realtype'} eq $in{'type'} }
26 &list_operating_systems();
27 $gconfig{'os_type'} = $in{'itype'};
28 $in{'iversion'} || &error($text{'os_eiversion'});
29 $gconfig{'os_version'} = $in{'iversion'};
31 $gconfig{'path'} = join($path_separator, split(/[\r\n]+/, $in{'path'}));
32 $gconfig{'syspath'} = !$in{'syspath'};
33 if ($gconfig{'ld_env'}) {
34 $gconfig{'ld_path'} = join($path_separator,
35 split(/[\r\n]+/, $in{'ld_path'}));
37 &write_file("$config_directory/config", \%gconfig);
38 &unlock_file("$config_directory/config");
40 &lock_file($ENV{'MINISERV_CONFIG'});
41 &get_miniserv_config(\%miniserv);
42 foreach $e (keys %miniserv) {
43 delete($miniserv{$e}) if ($e =~ /^env_(\S+)$/ &&
44 $1 ne "WEBMIN_CONFIG" && $1 ne "WEBMIN_VAR");
46 for($i=0; defined($n = $in{"name_$i"}); $i++) {
48 $miniserv{'env_'.$n} = $in{"value_$i"}
49 if ($n ne "WEBMIN_CONFIG" && $n ne "WEBMIN_VAR");
51 $miniserv{'perllib'} = join(':', split(/\r?\n/, $in{'perllib'}));
52 &put_miniserv_config(\%miniserv);
53 &unlock_file($ENV{'MINISERV_CONFIG'});
56 &webmin_log("os", undef, undef, \%in);