]> git.proxmox.com Git - pmg-api.git/commitdiff
periodically update subscription status
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 21 Dec 2017 06:36:22 +0000 (07:36 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 21 Dec 2017 06:36:22 +0000 (07:36 +0100)
bin/pmg-daily

index ebb78f2a38c590c32bc60d0c63d4d298e3275156..84fd47fa457780d66dad8e7cf9118113544380b8 100755 (executable)
@@ -16,6 +16,7 @@ use PMG::Utils;
 use PMG::Config;
 use PMG::ClusterConfig;
 use PMG::DBTools;
+use PMG::API2::Subscription;
 
 $SIG{'__WARN__'} = sub {
     my $err = $@;
@@ -30,6 +31,13 @@ PVE::RESTEnvironment->setup_default_cli_env();
 
 initlog('pmg-daily', 'mail');
 
+my $nodename = PVE::INotify::nodename();
+
+eval { PMG::API2::Subscription->update({ node => $nodename }); };
+if (my $err = $@) {
+    syslog ('err', "update subscription info failed: $err");
+}
+
 my $cfg = PMG::Config->new();
 
 if (my $statlifetime = $cfg->get ('admin', 'statlifetime')) {