Handle hostnames with upper-case letters
[webmin.git] / init / backup_config.pl
1
2 do 'init-lib.pl';
3
4 # backup_config_files()
5 # Returns files and directories that can be backed up
6 sub backup_config_files
7 {
8 local @rv;
9 if ($config{'init_base'}) {
10         local $a;
11         foreach $a (&list_actions()) {
12                 local @ac = split(/\s+/, $a);
13                 push(@rv, $ac[0] =~ /^\// ? $ac[0]
14                                           : "$config{'init_dir'}/$ac[0]");
15                 if ($config{'daemons_dir'} &&
16                     -r "$config{'daemons_dir'}/$ac[0]") {
17                         push(@rv, "$config{'daemons_dir'}/$ac[0]");
18                         }
19                 local $ufile = "/etc/init/$ac[0]";
20                 if (-r $ufile) {
21                         push(@rv, $ufile);
22                         }
23                 }
24         }
25 else {
26         # Just bootup and shutdown scripts
27         push(@rv, $config{'local_script'});
28         push(@rv, $config{'local_down'}) if ($config{'local_down'});
29         }
30 return @rv;
31 }
32
33 # pre_backup(&files)
34 # Called before the files are actually read
35 sub pre_backup
36 {
37 return undef;
38 }
39
40 # post_backup(&files)
41 # Called after the files are actually read
42 sub post_backup
43 {
44 return undef;
45 }
46
47 # pre_restore(&files)
48 # Called before the files are restored from a backup
49 sub pre_restore
50 {
51 return undef;
52 }
53
54 # post_restore(&files)
55 # Called after the files are restored from a backup
56 sub post_restore
57 {
58 }
59
60 1;
61