summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2002-08-02 17:10:01 +0000
committerDaouda Lo <daouda@mandriva.com>2002-08-02 17:10:01 +0000
commitaf75fb57ab9cefb6670c2ec4e359f7ee6f4f9441 (patch)
treebefc930dc9bc074887225c9e0ece9aa3d1acf36a
parentef1b357a7e0e42903da20e2cfc453b781b2626ed (diff)
downloaddrakx-af75fb57ab9cefb6670c2ec4e359f7ee6f4f9441.tar
drakx-af75fb57ab9cefb6670c2ec4e359f7ee6f4f9441.tar.gz
drakx-af75fb57ab9cefb6670c2ec4e359f7ee6f4f9441.tar.bz2
drakx-af75fb57ab9cefb6670c2ec4e359f7ee6f4f9441.tar.xz
drakx-af75fb57ab9cefb6670c2ec4e359f7ee6f4f9441.zip
- disable sms alerts (free sms site too complicated to
handle). Postponed - mail service should work now - clean up code - give the correct right to cron file to work correctly - fix titi mess
-rwxr-xr-xperl-install/standalone/logdrake52
1 files changed, 30 insertions, 22 deletions
diff --git a/perl-install/standalone/logdrake b/perl-install/standalone/logdrake
index b06cad84f..a815104ed 100755
--- a/perl-install/standalone/logdrake
+++ b/perl-install/standalone/logdrake
@@ -58,6 +58,7 @@ use Data::Dumper;
$::isInstall and die "Not supported during install.\n";
my $in = 'interactive'->vnew('su', 'default');
+my $cron_hourly = "/etc/cron.hourly/logdrake_service";
if ($::isEmbedded) {
print "EMBED\n";
@@ -433,10 +434,9 @@ my $initdir = "/etc/init.d";
]) or goto begin;
$cron .= "#- check services\n";
- for (keys %$service) {
-# $cron .= $l->{ $_ }[2]."\n" if (${ $_ });
- if(!-e "/var/lock/subsys/$_") { $r .= "Service $_ ($service->{ $_ } is not running\n" };
- $cron .= "$r" if ${ $_ }; # take a look at this, don't know what is done here
+ foreach (@installed_d) {
+ if(!-e "/var/lock/subsys/$_") { $r .= "Service $_ ($service->{$_} is not running\n" };
+# $cron .= "$r" if ${ $_ }; # take a look at this, don't know what is done here
}
step_load:
@@ -462,11 +462,10 @@ $r .= "Load is huge: $load\n" if ($load >@ . "$load);\n\n";
{ label => "email", val => \$email, disabled => sub { !$mail } },
#{ label => "smtp", val => \$smtp, disabled => sub { !$mail } },
{ label => "" },
- { label => "sms output", val => \$sms, type => "bool", text => "You need to have smsend set up (works only for some countries)" },
- { label => "smssend output", val => \$smssend , disabled => sub { !$sms } },
+# { label => "sms output", val => \$sms, type => "bool", text => "You need to have smsend set up (works only for some countries)" },
+ # { label => "smssend output", val => \$smssend , disabled => sub { !$sms } },
]) or goto step_load;
-#output("/etc/cron.hourly/logdrake_alert.pl", ($cron));
$cron .= q@#- report it@;
if ($mail) {
$cron .= q!
@@ -479,10 +478,16 @@ To: ), "$email\n";
print F $r;
# EOF!;
- } elsif ($sms) {
- $in->do_pkgs->install('smssend');
- $cron .= q!system(smssend !, $smssend, q! chomp_(`date`));
- }
+ output "$cron_hourly", $cron;
+ chmod 0755, $cron_hourly;
+ }
+
+ print ("whole cron is ****** $cron *******\n");
+
+#elsif ($sms) {
+ #$in->do_pkgs->install('smssend');
+ # $cron .= q!system(smssend !, $smssend, q!chomp_(`date`));
+#}
undef $::isWizard;
$::WizardWindow->destroy if defined $::WizardWindow;
@@ -503,18 +508,13 @@ sub save {
output($yy,$log_text->get_chars(0,$log_text->get_length()));
}
-sub print_hello {
- print "mcdtg !\n";
-}
-
sub get_main_menu {
- my ($window) = @_;
-
- my $accel_group = new Gtk::AccelGroup();
- my $item_factory = new Gtk::ItemFactory('Gtk::MenuBar', '<main>', $accel_group);
- $item_factory->create_items(@menu_items);
- $window->add_accel_group($accel_group);
- return ($item_factory->get_widget('<main>'));
+ my ($window) = @_;
+ my $accel_group = new Gtk::AccelGroup();
+ my $item_factory = new Gtk::ItemFactory('Gtk::MenuBar', '<main>', $accel_group);
+ $item_factory->create_items(@menu_items);
+ $window->add_accel_group($accel_group);
+ return ($item_factory->get_widget('<main>'));
}
sub create_dialog {
@@ -554,6 +554,14 @@ sub destroy_window {
# log
# $Log$
+# Revision 1.20 2002/08/02 17:10:01 daouda
+# - disable sms alerts (free sms site too complicated to
+# handle). Postponed
+# - mail service should work now
+# - clean up code
+# - give the correct right to cron file to work correctly
+# - fix titi mess
+#
# Revision 1.19 2002/08/01 17:24:58 tvignaud
# perl_checker fixes
#
span class="hl str">"mouse" if -e "/dev/mouse"; $o; } sub getinfoFromXF86Config { my $o = shift || {}; #- original $::o->{X} which must be changed only if sure! my $prefix = shift || ""; my (%keyboard, %mouse, %wacom, %card, %monitor); my (%c, $depth, $driver); local $_; local *G; open G, "$prefix/etc/X11/XF86Config-4"; while (<G>) { if (my $i = /^Section "InputDevice"/ .. /^EndSection/) { %c = () if $i == 1; $c{driver} = $1 if /^\s*Driver\s+"(.*?)"/; $c{id} = $1 if /^\s*Identifier\s+"[^\d"]*(\d*)"/; $c{xkb_model} ||= $1 if /^\s*Option\s+"XkbModel"\s+"(.*?)"/; $c{xkb_keymap} ||= $1 if /^\s*Option\s+"XkbLayout"\s+"(.*?)"/; $c{XMOUSETYPE} ||= $1 if /^\s*Option\s+"Protocol"\s+"(.*?)"/; $c{device} ||= $1 if /^\s*Option\s+"Device"\s+"\/dev\/(.*?)"/; $c{chordmiddle} ||= $1 if /^\s*Option\s+"ChordMiddle"\s+"\/dev\/(.*?)"/; $c{nbuttons} = 2 if /^\s*Option\s+"Emulate3Buttons"\s+/; $c{nbuttons} ||= 3 if /^\s*#\s*Option\s+"Emulate3Buttons"\s+/; $c{nbuttons} ||= 5 if /^\s*#\s*Option\s+"ZAxisMapping"\s.*5/; $c{nbuttons} = 7 if /^\s*#\s*Option\s+"ZAxisMapping"\s.*7/; if ($i =~ /E0/) { @keyboard{qw(xkb_keymap)} = @c{qw(xkb_keymap)} if $c{driver} =~ /keyboard/i; @{$mouse{auxmouse}}{qw(XMOUSETYPE device chordmiddle nbuttons)} = @c{qw(XMOUSETYPE device chordmiddle nbuttons)} if $c{driver} =~ /mouse/i && $c{id} > 1; @mouse{qw(XMOUSETYPE device chordmiddle nbuttons)} = @c{qw(XMOUSETYPE device chordmiddle nbuttons)} if $c{driver} =~ /mouse/i && $c{id} < 1; $wacom{$c{device}} = undef if $c{driver} =~ /wacom/i; } } elsif (/^Section "Monitor"/ .. /^EndSection/) { $monitor{type} ||= $1 if /^\s*Identifier\s+"(.*?)"/; $monitor{hsyncrange} ||= $1 if /^\s*HorizSync\s+(.*)/; $monitor{vsyncrange} ||= $1 if /^\s*VertRefresh\s+(.*)/; $monitor{vendor} ||= $1 if /^\s*VendorName\s+"(.*?)"/; $monitor{model} ||= $1 if /^\s*ModelName\s+"(.*?)"/; $monitor{modelines_}{"$1_$2"} = $_ if /^\s*Mode[lL]ine\s+(\S+)\s+(\S+)\s+/; } elsif (my $s = /^Section "Screen"/ .. /^EndSection/) { $card{default_depth} ||= $1 if /^\s*DefaultColorDepth\s+(\d+)/; if (my $i = /^\s*Subsection\s+"Display"/ .. /^\s*EndSubsection/) { undef $depth if $i == 1; $depth = $1 if /^\s*Depth\s+(\d*)/; if (/^\s*Modes\s+(.*)/) { my $a = 0; unshift @{$card{depth}{$depth || 8} ||= []}, #- insert at the beginning for resolution_wanted! grep { $_->[0] >= 640 } map { [ /"(\d+)x(\d+)"/ ] } split ' ', $1; } } } } close G; local *F; open F, "$prefix/etc/X11/XF86Config"; while (<F>) { if (/^Section "Keyboard"/ .. /^EndSection/) { $keyboard{xkb_model} ||= $1 if /^\s*XkbModel\s+"(.*?)"/; $keyboard{xkb_keymap} ||= $1 if /^\s*XkbLayout\s+"(.*?)"/; } elsif (/^Section "Pointer"/ .. /^EndSection/) { $mouse{XMOUSETYPE} ||= $1 if /^\s*Protocol\s+"(.*?)"/; $mouse{device} ||= $1 if m|^\s*Device\s+"/dev/(.*?)"|; $mouse{cleardtrrts} ||= 1 if m/^\s*ClearDTR\s+/; $mouse{cleardtrrts} ||= 1 if m/^\s*ClearRTS\s+/; $mouse{chordmiddle} ||= 1 if m/^\s*ChordMiddle\s+/; $mouse{nbuttons} = 2 if m/^\s*Emulate3Buttons\s+/; $mouse{nbuttons} ||= 3 if m/^\s*#\s*Emulate3Buttons\s+/; $mouse{nbuttons} ||= 5 if m/^\s*ZAxisMapping\s.*5/; $mouse{nbuttons} = 7 if m/^\s*ZAxisMapping\s.*7/; } elsif (/^Section "XInput"/ .. /^EndSection/) { if (/^\s*SubSection "Wacom/ .. /^\s*EndSubSection/) { $wacom{$1} = undef if /^\s*Port\s+"\/dev\/(.*?)"/; } } elsif (/^Section "Monitor"/ .. /^EndSection/) { $monitor{type} ||= $1 if /^\s*Identifier\s+"(.*?)"/; $monitor{hsyncrange} ||= $1 if /^\s*HorizSync\s+(.*)/; $monitor{vsyncrange} ||= $1 if /^\s*VertRefresh\s+(.*)/; $monitor{vendor} ||= $1 if /^\s*VendorName\s+"(.*?)"/; $monitor{model} ||= $1 if /^\s*ModelName\s+"(.*?)"/; $monitor{modelines_}{"$1_$2"} = $_ if /^\s*Mode[lL]ine\s+(\S+)\s+(\S+)\s+/; } elsif (my $i = /^Section "Device"/ .. /^EndSection/) { %c = () if $i == 1; $c{type} ||= $1 if /^\s*Identifier\s+"(.*?)"/; $c{memory} ||= $1 if /VideoRam\s+(\d+)/; $c{flags}{needVideoRam} ||= 1 if /^\s*VideoRam\s+/; $c{vendor} ||= $1 if /^\s*VendorName\s+"(.*?)"/; $c{board} ||= $1 if /^\s*BoardName\s+"(.*?)"/; $c{driver} ||= $1 if /^\s*Driver\s+"(.*?)"/; $c{options_xf3}{$1} ||= 1 if /^\s*Option\s+"(.*?)"/; $c{options_xf3}{$1} ||= 0 if /^\s*#\s*Option\s+"(.*?)"/; add2hash(\%card, \%c) if ($i =~ /E0/ && $c{type} && $c{type} ne "Generic VGA"); } elsif (my $s = /^Section "Screen"/ .. /^EndSection/) { undef $driver if $s == 1; $driver = $1 if /^\s*Driver\s+"(.*?)"/; if ($driver eq $Xconfigurator::serversdriver{$card{server}}) { $card{default_depth} ||= $1 if /^\s*DefaultColorDepth\s+(\d+)/; if (my $i = /^\s*Subsection\s+"Display"/ .. /^\s*EndSubsection/) { undef $depth if $i == 1; $depth = $1 if /^\s*Depth\s+(\d*)/; if (/^\s*Modes\s+(.*)/) { my $a = 0; unshift @{$card{depth}{$depth || 8} ||= []}, #- insert at the beginning for resolution_wanted! grep { $_->[0] >= 640 } map { [ /"(\d+)x(\d+)"/ ] } split ' ', $1; } } } } } close F; #- clean up modeline by those automatically given by $modelines_text. foreach (split /\n/, $Xconfigurator::modelines_text) { delete $monitor{modelines_}{"$1_$2"} if /^\s*Mode[lL]ine\s+(\S+)\s+(\S+)\s+(.*)/; } $monitor{modelines} .= $_ foreach values %{$monitor{modelines_}}; delete $monitor{modelines_}; #- get the default resolution according the the current file. #- suggestion to take into account, but that have to be checked. $o->{card}{suggest_depth} = $card{default_depth}; if (my @depth = keys %{$card{depth}}) { $o->{card}{suggest_wres} = ($card{depth}{$o->{card}{suggest_depth} || $depth[0]}[0][0]); } #- try to merge with $o, the previous has been obtained by ddcxinfos. add2hash($o->{keyboard} ||= {}, \%keyboard); add2hash($o->{mouse} ||= {}, \%mouse); add2hash($o->{mouse}{auxmouse} ||= {}, $mouse{auxmouse}) if $mouse{auxmouse}{XMOUSETYPE}; @{$o->{wacom} || []} > 0 or $o->{wacom} = [ keys %wacom ]; add2hash($o->{monitor} ||= {}, \%monitor); $o; } sub getinfoFromSysconfig { my $o = shift || {}; my $prefix = shift || ""; add2hash($o->{mouse} ||= {}, { getVarsFromSh("$prefix/etc/sysconfig/mouse") }); if (my %keyboard = getVarsFromSh "$prefix/etc/sysconfig/keyboard") { $o->{keyboard}{xkb_keymap} ||= keymap_translate($keyboard{KEYTABLE}) if $keyboard{KEYTABLE}; } $o; } sub getinfoFromDDC { my $o = shift || {}; my $O = $o->{monitor} ||= {}; #- return $o if $O->{hsyncrange} && $O->{vsyncrange} && $O->{modelines}; my ($m, @l) = `ddcxinfos`; $? == 0 or return $o; $o->{card}{memory} ||= to_int($m); local $_; while (($_ = shift @l) ne "\n") { my ($depth, $x, $y) = split; $depth = int(log($depth) / log(2)); if ($depth >= 8 && $x >= 640) { push @{$o->{card}{depth}{$depth}}, [ $x, $y ] unless scalar grep { $_->[0] == $x && $_->[1] == $y } @{$o->{card}{depth}{$depth}}; push @{$o->{card}{depth}{32}}, [ $x, $y ] if $depth == 24 && ! scalar grep { $_->[0] == $x && $_->[1] == $y } @{$o->{card}{depth}{32}}; } } my ($h, $v, $size, @m) = @l; chop $h; chop $v; $O->{hsyncrange} ||= $h; $O->{vsyncrange} ||= $v; $O->{size} ||= to_float($size); $O->{modelines} ||= join '', @m; $o; }