diff options
author | Daouda Lo <daouda@mandriva.com> | 2004-03-02 14:00:57 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2004-03-02 14:00:57 +0000 |
commit | dbac4a23940db92bc19b00b1dfa9f07cade5ebe7 (patch) | |
tree | 31634e75355109d8707305a3442feca29da77654 /mdkonline | |
parent | d640b95a639af713957a4d98513b51ee12cc3ad9 (diff) | |
download | mgaonline-dbac4a23940db92bc19b00b1dfa9f07cade5ebe7.tar mgaonline-dbac4a23940db92bc19b00b1dfa9f07cade5ebe7.tar.gz mgaonline-dbac4a23940db92bc19b00b1dfa9f07cade5ebe7.tar.bz2 mgaonline-dbac4a23940db92bc19b00b1dfa9f07cade5ebe7.tar.xz mgaonline-dbac4a23940db92bc19b00b1dfa9f07cade5ebe7.zip |
- fix wide conf writtings
Diffstat (limited to 'mdkonline')
-rwxr-xr-x | mdkonline | 27 |
1 files changed, 18 insertions, 9 deletions
@@ -4,9 +4,9 @@ # # # Copyright (C) 2001-2002-2003-2004 MandrakeSoft # # # -# Renaud Chaillat # # Daouda Lo <daouda@mandrakesoft.com> # -# # +# Renaud Chaillat # +# # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License Version 2 as # # published by the Free Software Foundation. # @@ -52,6 +52,8 @@ my $VERSION = '1.0'; my ($create_account, $auto_update) = (0, 0); my $linkAccount = "http://www.mandrakeexpert.com/index2.php"; +my $wideconf = '/etc/sysconfig/mdkonline'; + my ($o, $p); $o->{mw} = ugtk2->new("MandrakeOnline" . " " . $VERSION, center => 1); @@ -63,7 +65,7 @@ $o->{nb}->set_show_tabs(0); $o->{nb}->set_show_border(0); $o->{bottomHbox} = Gtk2::HBox->new; my %stage = ( 0 => sub { if ($o->{account_cb}->get_active) { subsOnline() } else { $o->{nb}->next_page} }, - 1 => sub { $o->{nb}->next_page() }, + 1 => sub { $o->{nb}->next_page(); setEntryWithConf() }, 2 => sub { testPasswd() }, 3 => sub { sendConfig() }, 4 => sub { setConf() } @@ -195,6 +197,10 @@ sub checkErrors { raiseError($o->{mw}->{window},N("Error"), N("Not a valid mail address!\n")) } } +sub setEntryWithConf { + my %t = getVarsFromSh($wideconf); + foreach (qw(login machine)) { $o->{$_}->set_text($t->{uc{$_}}) } +} sub sendConfig { # When we arrive here, we're sure the login/passwd is correct # print STDERR "Sending config\n"; @@ -228,7 +234,7 @@ sub sendConfig { remove_wait_msg($w); if ($response->is_success) { $result = ($response->content =~ /^TRUE(.*)/) ? 0 : -1; - printf("Send Config :\nNEWKEY=%s\nRESPONSE=%s", $1, $response->content); + #printf("Send Config :\nNEWKEY=%s\nRESPONSE=%s", $1, $response->content); $o->{currentkey} = $1; } else { # pb with the connection ? @@ -246,6 +252,7 @@ sub sendConfig { } sub setConf { if ($o->{autoup}->get_active) { automatedUpgrades() } + writeWideConf(); } sub init { my $i = shift; @@ -386,13 +393,15 @@ COUNTRY=$country qq(#!/bin/bash if [ -f /root/.mdkupdate ]; then /usr/bin/mdkupdate --auto; fi ); + +chmod 0755, "/etc/cron.daily/mdkupdate"; +} +sub writeWideConf { my $date = chomp_(`date`); - output_with_perm "/etc/sysconfig/mdkonline", 644, + output_with_perm $wideconf, 644, qq(LOGIN=$login -BOX=$boxname +MACHINE=$boxname COUNTRY=$country -LASTCHECK=$date ); - -chmod 0755, "/etc/cron.daily/mdkupdate"; + } |