]> git.proxmox.com Git - pmg-api.git/blobdiff - PMG/Config.pm
pmg config: fix avast scan executable path documentation
[pmg-api.git] / PMG / Config.pm
index 9f1c001e5913630f81a427dcebb08af745cddfb2..2392db8eaefeff84eba5351280cfeea4c4d472ff 100755 (executable)
@@ -93,7 +93,7 @@ sub properties {
            pattern => "http://.*",
        },
        avast => {
-           description => "Use Avast Virus Scanner (/bin/scan). You need to buy and install 'Avast Core Security' before you can enable this feature.",
+           description => "Use Avast Virus Scanner (/usr/bin/scan). You need to buy and install 'Avast Core Security' before you can enable this feature.",
            type => 'boolean',
            default => 0,
        },
@@ -1192,7 +1192,7 @@ sub get_template_vars {
     }
 
     my $netlist = PVE::INotify::read_file('mynetworks');
-    foreach my $cidr (keys %$netlist) {
+    foreach my $cidr (sort keys %$netlist) {
        if ($cidr =~ m/^($IPV6RE)\/(\d+)$/) {
            push @$mynetworks, "[$1]/$2";
        } else {
@@ -1550,8 +1550,13 @@ sub rewrite_config {
 
     $force_restart = {} if ! $force_restart;
 
+    my $log_restart = sub {
+       syslog ('info', "configuration change detected for '$_[0]', restarting");
+    };
+
     if (($self->rewrite_config_postfix($rulecache) && $restart_services) ||
        $force_restart->{postfix}) {
+       $log_restart->('postfix');
        PMG::Utils::service_cmd('postfix', 'reload');
     }
 
@@ -1566,16 +1571,19 @@ sub rewrite_config {
 
     if (($self->rewrite_config_spam() && $restart_services) ||
        $force_restart->{spam}) {
+       $log_restart->('pmg-smtp-filter');
        PMG::Utils::service_cmd('pmg-smtp-filter', 'restart');
     }
 
     if (($self->rewrite_config_clam() && $restart_services) ||
        $force_restart->{clam}) {
+       $log_restart->('clamav-daemon');
        PMG::Utils::service_cmd('clamav-daemon', 'restart');
     }
 
     if (($self->rewrite_config_freshclam() && $restart_services) ||
        $force_restart->{freshclam}) {
+       $log_restart->('clamav-freshclam');
        PMG::Utils::service_cmd('clamav-freshclam', 'restart');
     }
 }