pveam 481 Bytes
Newer Older
1
#!/usr/bin/perl
2 3

use strict;
4
use warnings;
5
use PVE::Cluster;
6
use PVE::APLInfo;
7 8 9 10 11 12 13 14 15

if (scalar (@ARGV) != 1) {
    print STDERR "usage: $0 CMD\n";
    exit (-1);
}

my $cmd = shift;

if ($cmd eq 'update') {
16
    my $dccfg = PVE::Cluster::cfs_read_file('datacenter.cfg');
17 18
    exit (0) if PVE::APLInfo::update($dccfg->{http_proxy});
    print STDERR "update failed - see /var/log/pveam.log for details\n";
19 20 21 22 23
    exit (-1);
} else {
    print STDERR "unknown CMD '$cmd'\n";
    exit (-1);
}