Handle hostnames with upper-case letters
[webmin.git] / sentry / backup_config.pl
1
2 do 'sentry-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 push(@rv, $config{'portsentry_config'})
10         if (&has_command($config{'portsentry'}));
11 push(@rv, $config{'hostsentry_config'})
12         if (-r $config{'hostsentry'});
13 push(@rv, $config{'logcheck'})
14         if (&has_command($config{'logcheck'}));
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 if (&has_command($config{'portsentry'})) {
44         # Re-start portsentry, if running
45         local @pids = &get_portsentry_pids();
46         if (@pids) {
47                 &stop_portsentry();
48                 local $err = &start_portsentry();
49                 return $err if ($err);
50                 }
51         }
52 if (&has_command($config{'hostsentry'})) {
53         # Re-start hostsentry, if running
54         $pid = &get_hostsentry_pid();
55         if ($pid) {
56                 &stop_hostsentry();
57                 local $err = &start_hostsentry();
58                 return $err if ($err);
59                 }
60         }
61 return undef;
62 }
63
64 1;
65