diff options
author | Daouda Lo <daouda@mandriva.com> | 2004-10-29 18:29:33 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2004-10-29 18:29:33 +0000 |
commit | b509846afcccab667f31ec0527d4fc244050fd9a (patch) | |
tree | 28dcfb4c54e5301ba4fc20b859a2bfaa5bb99718 | |
parent | 208e32c177f2d2fa8fbf77f3253034ec8674945d (diff) | |
download | mgaonline-b509846afcccab667f31ec0527d4fc244050fd9a.tar mgaonline-b509846afcccab667f31ec0527d4fc244050fd9a.tar.gz mgaonline-b509846afcccab667f31ec0527d4fc244050fd9a.tar.bz2 mgaonline-b509846afcccab667f31ec0527d4fc244050fd9a.tar.xz mgaonline-b509846afcccab667f31ec0527d4fc244050fd9a.zip |
- full MNF support
-rwxr-xr-x | mdkonline_tui | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/mdkonline_tui b/mdkonline_tui index f9b00cb3..2698f637 100755 --- a/mdkonline_tui +++ b/mdkonline_tui @@ -29,6 +29,8 @@ use common; use wizards; use lang; +use Getopt::Long; + BEGIN { unshift @::textdomains, 'mdkonline', 'drakfirstboot' }; use mdkonline; @@ -41,6 +43,7 @@ my $online_link = 'https://www.mandrakeonline.net'; my $confdir = '/root/.MdkOnline'; my $conffile = "$confdir/mdkupdate"; +my $logfile = '/tmp/mdkonline.log'; #for compatibilities mkdir_p($confdir) if !-d $confdir; @@ -52,9 +55,13 @@ my %choices = ( account => N("I already have an account"), noaccount => N("I want to subscribe") ); + my $choice = $choices{account}; my ($wiz, $login, $nlogin, $password, $npassword, $boxname, $cfmpassword, $email, $is_success, $key, $r, $createaccount, $sendconfres, $country); + +GetOptions('login=s' => \$login, 'pass=s' => \$password, 'box=s' => \$boxname, 'country:s' => \$country); + my %countries = map { lang::c2name($_) => $_ } lang::list_countries(); $country = lang::c2name(lang::read('', $>)->{country}); @@ -197,4 +204,16 @@ $wiz = { } }; -wizards->new->safe_process($wiz, $in); +if ($login && $password && $boxname) { + $is_success = check_login($login, $password, $boxname); + if ($is_success) { + ($sendconfres, $key) = send_conf($login, $password, $boxname); + if ($sendconfres eq 'TRUE' && $key) { + mdkonline::automated_upgrades($conffile, $login, md5_hex($password), $boxname, $key, $country, 'TRUE'); + mdkonline::write_wide_conf($login, $boxname, $country); + output($logfile, N("Configuration uploaded successfully")) + } else { output($logfile, N("Problem uploading configuration")) } + } else { output($logfile, N("Cannot connect to mandrakeonline website: wrong login/password or router/firewall bad settings")) } +} else { + wizards->new->safe_process($wiz, $in); +} |