summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2005-02-28 14:05:49 +0000
committerDaouda Lo <daouda@mandriva.com>2005-02-28 14:05:49 +0000
commit90593813417f8b0a2640f34df0dd78b3f38852cb (patch)
tree099825962ac9aa50478c79170d6f35b43b2fcc15
parent48b053a818fd2978e189d9401eab3b907bc5f67f (diff)
downloadmgaonline-90593813417f8b0a2640f34df0dd78b3f38852cb.tar
mgaonline-90593813417f8b0a2640f34df0dd78b3f38852cb.tar.gz
mgaonline-90593813417f8b0a2640f34df0dd78b3f38852cb.tar.bz2
mgaonline-90593813417f8b0a2640f34df0dd78b3f38852cb.tar.xz
mgaonline-90593813417f8b0a2640f34df0dd78b3f38852cb.zip
- added interactive option to pass the mnf all in one authentication
and upload
-rwxr-xr-xmdkonline24
1 files changed, 14 insertions, 10 deletions
diff --git a/mdkonline b/mdkonline
index b7f22dde..639a31ce 100755
--- a/mdkonline
+++ b/mdkonline
@@ -36,8 +36,6 @@ BEGIN { unshift @::textdomains, 'mdkonline', 'drakfirstboot' }
use mdkonline;
use Digest::MD5 qw(md5 md5_hex md5_base64);
-my $in = interactive->vnew('su');
-
my $expert_link = 'http://www.mandrakeexpert.com';
my $online_link = 'https://www.mandrakeonline.net';
@@ -45,10 +43,18 @@ my $confdir = '/root/.MdkOnline';
my $conffile = "$confdir/mdkupdate";
my $logfile = '/var/tmp/mdkonline.log';
+my ($wiz, $login, $nlogin, $password, $npassword, $boxname, $cfmpassword, $email, $is_success, $key, $r, $createaccount, $sendconfres, $country, $ia);
+
+$ia = 1;
+
+GetOptions('interactive!' => \$ia, 'login=s' => \$login, 'pass=s' => \$password, 'box=s' => \$boxname, 'country:s' => \$country);
+
#for compatibilities
mkdir_p($confdir) if !-d $confdir;
-e '/root/.mdkupdate' and system("mv", "/root/.mdkupdate", $conffile);
+my $in = interactive->vnew('su') if $ia;
+
$::Wizard_title = N("Mandrakeonline");
my %choices = (
@@ -58,9 +64,7 @@ my %choices = (
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});
@@ -86,14 +90,14 @@ sub send_conf {
my ($log, $pass, $box) = @_;
my $uplink = $online_link . '/wizard.php';
my $pp = md5_hex($pass);
- my $w = $in->wait_message(N("Please wait"), N("Reading configuration\n"));
+ my $w = $in->wait_message(N("Please wait"), N("Reading configuration\n")) if $ia;
mdkonline::report_config("$confdir/$log.$pp.$box.online.log");
my $tag = { submit => "upload_wizard", wizard => ["$confdir/$log.$pp.$box.online.log.bz2.uue"] };
- undef $w;
- my $ww = $in->wait_message(N("Please wait"), N("Sending configuration..."));
+ undef $w if $w;
+ my $ww = $in->wait_message(N("Please wait"), N("Sending configuration...")) if $ia;
($sendconfres, $key) = mdkonline::send_config($uplink, $tag);
mdkonline::hw_upload($log, $pass, $box);
- undef $ww;
+ undef $ww if $ww;
($sendconfres, $key);
}
sub create_new_account {
@@ -128,7 +132,7 @@ $wiz = {
];
},
post => sub {
- my $_wait = $in->wait_message(N("Please wait"), N("Connecting to Mandrakeonline website..."));
+ my $_wait = $in->wait_message(N("Please wait"), N("Connecting to Mandrakeonline website...")) if $ia;
$is_success = check_login($login, $password, $boxname); undef($_wait);
"authenticate";
},
@@ -209,7 +213,7 @@ $wiz = {
}
};
-if ($login && $password && $boxname) {
+if (!$ia && $login && $password && $boxname) {
$is_success = check_login($login, $password, $boxname);
if ($is_success) {
($sendconfres, $key) = send_conf($login, $password, $boxname);