File: install_check.pl

package info (click to toggle)
webmin-extra 1.180-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 12,324 kB
  • ctags: 1,200
  • sloc: perl: 39,117; makefile: 125
file content (24 lines) | stat: -rw-r--r-- 555 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# install_check.pl

do 'firewall-lib.pl';

# is_installed(mode)
# For mode 1, returns 2 if the server is installed and configured for use by
# Webmin, 1 if installed but not configured, or 0 otherwise.
# For mode 0, returns 1 if installed, 0 if not
sub is_installed
{
return 0 if (&missing_firewall_commands());
local $out = `iptables -n -t filter -L OUTPUT 2>&1`;
return 0 if ($?);
if ($_[0]) {
	if (!$config{'direct'} &&
	    (defined(&check_iptables) && &check_iptables() ||
	     !-s $iptables_save_file)) {
		return 1;
		}
	return 2;
	}
return 1;
}