Handle hostnames with upper-case letters
[webmin.git] / shorewall / backup_config.pl
1
2 do 'shorewall-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 opendir(DIR, $config{'config_dir'});
10 while($f = readdir(DIR)) {
11         next if ($f eq "." || $f eq ".." ||
12                  $f =~ /\.rpmsave$/ || $f =~ /\.bak$/);
13         push(@rv, "$config{'config_dir'}/$f");
14         }
15 return @rv;
16 }
17
18 # pre_backup(&files)
19 # Called before the files are actually read
20 sub pre_backup
21 {
22 return undef;
23 }
24
25 # post_backup(&files)
26 # Called after the files are actually read
27 sub post_backup
28 {
29 return undef;
30 }
31
32 # pre_restore(&files)
33 # Called before the files are restored from a backup
34 sub pre_restore
35 {
36 return undef;
37 }
38
39 # post_restore(&files)
40 # Called after the files are restored from a backup
41 sub post_restore
42 {
43 local $out = &backquote_logged("$config{'shorewall'} restart 2>&1");
44 if ($?) {
45         return "<pre>$out</pre>";
46         }
47 return undef;
48 }
49
50 1;
51