Include hostname config files in backups

This commit is contained in:
Jamie Cameron
2010-01-18 13:34:47 -08:00
parent 1394634a0f
commit 1eb81a6661
5 changed files with 22 additions and 0 deletions

View 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.

View File

@ -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);
}

View File

@ -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
{

View File

@ -285,6 +285,11 @@ else {
return @rv;
}
sub network_config_files
{
return ( "/etc/HOSTNAME", $network_config );
}
sub routing_input
{
local (%conf, @st, @hr, %sysctl);

View File

@ -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