mirror of
https://git.proxmox.com/git/pve-client
synced 2025-10-04 17:21:28 +00:00
24 lines
440 B
Perl
24 lines
440 B
Perl
package PVE::APIClient::Config;
|
|
|
|
use strict;
|
|
use warnings;
|
|
use JSON;
|
|
use File::HomeDir;
|
|
|
|
use PVE::Tools;
|
|
|
|
sub load_config {
|
|
|
|
my $filename = home() . '/.pveclient';
|
|
my $conf_str = PVE::Tools::file_get_contents($filename);
|
|
|
|
my $filemode = (stat($filename))[2] & 07777;
|
|
if ($filemode != 0600) {
|
|
die sprintf "wrong permissions on '$filename' %04o (expected 0600)\n", $filemode;
|
|
}
|
|
|
|
return decode_json($conf_str);
|
|
};
|
|
|
|
1;
|