Backup config support

This commit is contained in:
Jamie Cameron
2008-06-17 21:22:10 +00:00
parent acdcd2fcaf
commit 900f5efe5d
3 changed files with 44 additions and 0 deletions

View File

@@ -13,3 +13,5 @@ Made the auto-registration email contents translatable.
Fixed return link when using a framed theme.
---- Changes since 1.320 ----
Added several new operating systems and distributions to the server type list.
---- Changes since 1.420 ----
Allow the Backup Configuration Files module to save and restore Webmin server details.

41
servers/backup_config.pl Normal file
View File

@@ -0,0 +1,41 @@
do 'servers-lib.pl';
# backup_config_files()
# Returns files and directories that can be backed up
sub backup_config_files
{
local @rv = map { $_->{'file'} } &list_servers();
return @rv;
}
# pre_backup(&files)
# Called before the files are actually read
sub pre_backup
{
return undef;
}
# post_backup(&files)
# Called after the files are actually read
sub post_backup
{
return undef;
}
# pre_restore(&files)
# Called before the files are restored from a backup
sub pre_restore
{
return undef;
}
# post_restore(&files)
# Called after the files are restored from a backup
sub post_restore
{
return undef;
}
1;

View File

@@ -56,6 +56,7 @@ sub get_server
local $serv;
$serv->{'id'} = $_[0];
&read_file("$module_config_directory/$_[0].serv", $serv) || return undef;
$serv->{'file'} = "$module_config_directory/$_[0].serv";
return $serv;
}