update
authorMaximilian Wilhelm <max@rfc2324.org>
Tue, 4 Oct 2005 15:17:57 +0000 (15:17 +0000)
committerMaximilian Wilhelm <max@rfc2324.org>
Tue, 4 Oct 2005 15:17:57 +0000 (15:17 +0000)
files/server/RBM/sshKeySync/Merge.pm

index c8f1b96..470dbb6 100644 (file)
@@ -485,21 +485,24 @@ sub publish_known_hosts() {
 
        print " * Publishing ssh_known_hosts files:\n" if ( $config->{verbose} );
        print "    - global ssh_known_hosts files...\n" if ( $config->{verbose} );
-       unless ( -f "$config->{base_dir}/ssh_known_hosts" ) {
+
+       if ( -f "$config->{base_dir}/ssh_known_hosts" ) {
+               unless ( copy( "$config->{base_dir}/ssh_known_hosts", "$config->{base_dir}/pub/" ) ) {
+                       print STDERR "Error, while copying global ssh_known_hosts file to public dir.\n";
+               }
+       } else {
                print STDERR "Global ssh_known_hosts file does not exist.\n";
        }
-       unless ( copy( "$config->{base_dir}/ssh_known_hosts", "$config->{base_dir}/pub/" ) ) {
-               print STDERR "Error, while copying global ssh_known_hosts file to public dir.\n";
-       }
 
        foreach my $domain (keys %${domains}) {
                if ( $domains->{$domain}->get_common_outfile() ) {
                        print "    - ssh_known_hosts file for domain ${domain}...\n" if ( $config->{verbose} );
-                       unless ( -f "$config->{base_dir}/$domain/ssh_known_hosts" ) {
-                               print STDERR "There is no ssh_known_hosts file for domain $domain\n";
-                       }
-                       unless ( copy( "$config->{base_dir}/$domain/ssh_known_hosts", "$config->{base_dir}/pub/ssh_known_hosts.${domain}" ) ) {
-                               print STDERR "Error while copying file...\n";
+                       if ( -f "$config->{base_dir}/$domain/ssh_known_hosts" ) {
+                               unless ( copy( "$config->{base_dir}/$domain/ssh_known_hosts", "$config->{base_dir}/pub/ssh_known_hosts.${domain}" ) ) {
+                                       print STDERR "Error while copying file...\n";
+                               }
+                       } else {
+                               print STDERR "Error: There is no ssh_known_hosts file for domain $domain\n";
                        }
                }
        }