Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
64f2aa74
Commit
64f2aa74
authored
Jul 25, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write auth.conf
parent
60d3dcce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
Subscription.pm
PVE/API2/Subscription.pm
+13
-0
No files found.
PVE/API2/Subscription.pm
View file @
64f2aa74
...
...
@@ -173,6 +173,15 @@ sub read_etc_pve_subscription {
return
$info
;
}
sub
write_apt_auth
{
my
$key
=
shift
;
my
$server_id
=
get_hwaddress
();
my
$auth
=
{
'
enterprise.proxmox.com
'
=>
{
login
=>
$key
,
password
=>
get_hwaddress
()
}
};
PVE::INotify::
update_file
('
apt-auth
',
$auth
);
}
sub
write_etc_pve_subscription
{
my
(
$filename
,
$fh
,
$info
)
=
@_
;
...
...
@@ -188,6 +197,8 @@ sub write_etc_pve_subscription {
my
$raw
=
"
$info
->{key}
\n
$csum
\n
$data
";
PVE::Tools::
safe_print
(
$filename
,
$fh
,
$raw
);
write_apt_auth
(
$info
->
{
key
});
}
sub
check_subscription
{
...
...
@@ -329,6 +340,8 @@ __PACKAGE__->register_method ({
my
$info
=
PVE::INotify::
read_file
('
subscription
');
return
undef
if
!
$info
;
write_apt_auth
(
$info
->
{
key
})
if
$info
->
{
key
};
if
(
!
$param
->
{
force
}
&&
$info
->
{
status
}
eq
'
Active
')
{
my
$age
=
time
()
-
$info
->
{
checktime
};
return
undef
if
$age
<
$localkeydays
*
60
*
60
*
24
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment