Handle hostnames with upper-case letters
[webmin.git] / adsl-client / backup_config.pl
1
2 do 'adsl-client-lib.pl';
3
4 # backup_config_files()
5 # Returns files and directories that can be backed up
6 sub backup_config_files
7 {
8 return ( $config{'pppoe_conf'}, $config{'pap_file'} );
9 }
10
11 # pre_backup(&files)
12 # Called before the files are actually read
13 sub pre_backup
14 {
15 return undef;
16 }
17
18 # post_backup(&files)
19 # Called after the files are actually read
20 sub post_backup
21 {
22 return undef;
23 }
24
25 # pre_restore(&files)
26 # Called before the files are restored from a backup
27 sub pre_restore
28 {
29 return undef;
30 }
31
32 # post_restore(&files)
33 # Called after the files are restored from a backup
34 sub post_restore
35 {
36 local ($dev, $ip) = &get_adsl_ip();
37 if ($ip || $dev) {
38         # Stop and re-start connection
39         local $out = &backquote_logged("$config{'stop_cmd'} 2>&1");
40         if ($?) {
41                 return "<pre>$out</pre>";
42                 }
43         $out = &backquote_logged("$config{'start_cmd'} 2>&1 </dev/null");
44         if ($?) {
45                 return "<pre>$out</pre>";
46                 }
47         }
48 return undef;
49 }
50
51 1;
52