Include hostname config files in backups
authorJamie Cameron <jcameron@webmin.com>
Mon, 18 Jan 2010 21:34:47 +0000 (13:34 -0800)
committerJamie Cameron <jcameron@webmin.com>
Mon, 18 Jan 2010 21:34:47 +0000 (13:34 -0800)
net/CHANGELOG
net/backup_config.pl
net/debian-linux-lib.pl
net/redhat-linux-lib.pl
net/solaris-lib.pl

index 62cd6a7..2b6b546 100644 (file)
@@ -54,3 +54,4 @@ On Debian systems, if the dns-nameservers option is defined in /etc/network/inte
 Updated bonding support to use the new format in Debian 5.0, thanks to Caspar Smit.
 ---- Changes since 1.500 ----
 Added a field for editing the MAC address to apply at boot time on Redhat and Debian-based systems.
+Include hostname configuration files in backups, thanks to Caspar Smit.
index 47aef36..f604f08 100755 (executable)
@@ -6,11 +6,17 @@ do 'net-lib.pl';
 sub backup_config_files
 {
 local @rv = ( $config{'hosts_file'} );
+if ($config{'ipnodes_file'}) {
+       push(@rv, $config{'ipnodes_file'});
+       }
 local $dns = &get_dns_config();
 push(@rv, @{$dns->{'files'}});
 if (defined(&routing_config_files)) {
        push(@rv, &routing_config_files());
        }
+if (defined(&network_config_files)) {
+       push(@rv, &network_config_files());
+       }
 push(@rv, map { $_->{'file'} } &boot_interfaces());
 return &unique(@rv);
 }
index f88af97..8ee6e40 100755 (executable)
@@ -427,6 +427,11 @@ sub routing_config_files
 return ( $network_interfaces_config );
 }
 
+sub network_config_files
+{
+return ( "/etc/hostname", "/etc/HOSTNAME", "/etc/mailname" );
+}
+
 # show default router and device
 sub routing_input
 {
index f48a546..7eb4dde 100755 (executable)
@@ -285,6 +285,11 @@ else {
 return @rv;
 }
 
+sub network_config_files
+{
+return ( "/etc/HOSTNAME", $network_config );
+}
+
 sub routing_input
 {
 local (%conf, @st, @hr, %sysctl);
index 3c3d3d7..7834789 100755 (executable)
@@ -346,6 +346,11 @@ sub routing_config_files
 return ( "/etc/defaultrouter", "/etc/notrouter", "/etc/gateways" );
 }
 
+sub network_config_files
+{
+return ( "/etc/nodename" );
+}
+
 # get_defaultrouters()
 # Returns a list of all default routers
 sub get_defaultrouters