]> git.proxmox.com Git - pve-manager.git/commitdiff
pveupdate - always run check for available updates
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 21 Dec 2017 09:15:47 +0000 (10:15 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 21 Dec 2017 09:17:56 +0000 (10:17 +0100)
bin/pveupdate

index 3a00335e9f4167d3312ef12741d17606753c49ae..952a54a40c8f79b9223f962e448b159a8991aa2d 100755 (executable)
@@ -42,15 +42,13 @@ if (my $err = $@) {
     syslog ('err', "update appliance info failed - see /var/log/pveam.log for details");
 }
 
-if (my $info = PVE::INotify::read_file('subscription')) {
-    # We assume that users with subscriptions want informations
-    # about new packages.
-    if ($info->{status} eq 'Active') {
-       eval { PVE::API2::APT->update_database({ node => $nodename, notify => 1, quiet => 1 }); };
-       if (my $err = $@) {
-           syslog ('err', "update apt database failed: $err");
-       }
-    }
+my $info = PVE::INotify::read_file('subscription');
+# We assume that users with subscriptions want informations
+# about new packages.
+my $notify = ($info && $info->{status} eq 'Active') ? 1 : 0;
+eval { PVE::API2::APT->update_database({ node => $nodename, notify => $notify, quiet => 1 }); };
+if (my $err = $@) {
+    syslog ('err', "update apt database failed: $err");
 }
 
 sub cleanup_tasks {