diff --git a/bin/pveupdate b/bin/pveupdate index 3a00335e..952a54a4 100755 --- a/bin/pveupdate +++ b/bin/pveupdate @@ -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 {