Handle hostnames with upper-case letters
[webmin.git] / firewall / gentoo-linux-lib.pl
1 # gentoo-linux-lib.pl
2 # Deal with gentoo's IPtables save file
3
4 # check_iptables()
5 # Returns an error message if something is wrong with iptables on this system
6 sub check_iptables
7 {
8 if (!-r "/etc/init.d/iptables") {
9         return &text('gentoo_escript', "<tt>/etc/init.d/iptables</tt>");
10         }
11 return undef;
12 }
13
14 local %iptconf;
15 &read_env_file("/etc/conf.d/iptables", \%iptconf);
16 $iptables_save_file = $iptconf{'IPTABLES_SAVE'};
17
18 # apply_iptables()
19 # Applies the current iptables configuration from the save file
20 sub apply_iptables
21 {
22 local $out = &backquote_logged("cd / ; /etc/init.d/iptables reload 2>&1");
23 return $? ? "<pre>$out</pre>" : undef;
24 }
25
26 1;
27