summaryrefslogtreecommitdiffstats
path: root/mdkupdate
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2006-04-04 13:17:28 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2006-04-04 13:17:28 +0000
commit1547e9e393b3a16cf89dd19d85766219aeb2116a (patch)
treea2a6324a91ad8496517350464446c1fcf51794c5 /mdkupdate
parent010c61607dae1edbf4d5843d8c957d554106f7c0 (diff)
downloadmgaonline-1547e9e393b3a16cf89dd19d85766219aeb2116a.tar
mgaonline-1547e9e393b3a16cf89dd19d85766219aeb2116a.tar.gz
mgaonline-1547e9e393b3a16cf89dd19d85766219aeb2116a.tar.bz2
mgaonline-1547e9e393b3a16cf89dd19d85766219aeb2116a.tar.xz
mgaonline-1547e9e393b3a16cf89dd19d85766219aeb2116a.zip
better way to fix autoregistering the host: write a config file so
that write_wide_conf() do not miss some fields
Diffstat (limited to 'mdkupdate')
-rwxr-xr-xmdkupdate10
1 files changed, 7 insertions, 3 deletions
diff --git a/mdkupdate b/mdkupdate
index a2ace304..e2fa7ba3 100755
--- a/mdkupdate
+++ b/mdkupdate
@@ -174,14 +174,18 @@ if (!$bundle) {
}
if (!($wc->{HOST_ID} && $wc->{HOST_KEY})) {
use lang;
- my $reg_host = mdkonline::soap_register_host($bundle_vars{USER}, $bundle_vars{PASS}, chomp_(cat_('/proc/sys/kernel/hostname')), ' ', lang::read()->{country});
+ my $hostname = chomp_(cat_('/proc/sys/kernel/hostname'));
+ my $reg_host = mdkonline::soap_register_host($bundle_vars{USER}, $bundle_vars{PASS}, $hostname, ' ', lang::read()->{country});
my $res = mdkonline::check_server_response($reg_host);
if ($res ne 'OK') {
$in->ask_warn(N("Error"), N("Failed to authenticate to the bundle server:\n\n%s", $reg_host->{message}));
exit(3);
}
- # we've no previous config so add missing fields to server's answer:
- $reg_host->{data}{user_email} ||= $bundle_vars{USER};
+ # we've no previous config so write one so that write_wide_conf() do not miss some fields:
+ setVarsInSh('/etc/sysconfig/mdkonline', {
+ USER_EMAIL => $bundle_vars{USER},
+ HOST_NAME => $hostname,
+ });
mdkonline::write_wide_conf($reg_host);
}