|
END
} else {
print "$Lang::tr{'profile has errors'}\n \n";
}
if ( $netsettings{'GREEN_DEV'} ) { print <$Lang::tr{'lan'}:
| $netsettings{'GREEN_ADDRESS'}
|
END
if ( `cat /var/ipfire/proxy/advanced/settings | grep ^ENABLE=on` ) {
print "Proxy an";
if ( `cat /var/ipfire/proxy/advanced/settings | grep ^TRANSPARENT=on` ) { print " (transparent)"; }
} else { print "Proxy aus"; }
}
if ( $netsettings{'BLUE_DEV'} ) { print <$Lang::tr{'wireless'}:
| $netsettings{'BLUE_ADDRESS'}
|
END
if ( `cat /var/ipfire/proxy/advanced/settings | grep ^ENABLE_BLUE=on` ) {
print "Proxy an";
if ( `cat /var/ipfire/proxy/advanced/settings | grep ^TRANSPARENT_BLUE=on` ) { print " (transparent)"; }
} else { print "Proxy aus"; }
}
if ( $netsettings{'ORANGE_DEV'} ) { print <$Lang::tr{'dmz'}:
| $netsettings{'ORANGE_ADDRESS'}
| Online
END
}
if ( `cat /var/ipfire/vpn/settings | grep ^ENABLED=on` ||
`cat /var/ipfire/vpn/settings | grep ^ENABLED_BLUE=on` ) {
my $ipsecip = `cat /var/ipfire/vpn/settings | grep ^VPN_IP= | cut -c 8-`;
print <$Lang::tr{'vpn'}:
| $ipsecip
| Online
END
}
if ( `cat /var/ipfire/ovpn/settings | grep ^ENABLED=on` ||
`cat /var/ipfire/ovpn/settings | grep ^ENABLED_BLUE=on` ||
`cat /var/ipfire/ovpn/settings | grep ^ENABLED_ORANGE=on`) {
my $ovpnip = `cat /var/ipfire/ovpn/settings | grep ^DOVPN_SUBNET= | cut -c 14- | sed -e 's\/\\/255.255.255.0\/\/'`;
print <OpenVPN:
| $ovpnip
| Online
END
}
if ( $netsettings{'DNS1'} ) { print <DNS-Server: | $netsettings{'DNS1'}
END
}
if ( $netsettings{'DNS2'} ) { print <$netsettings{'DNS2'}
END
}
print <
END
# Memory usage warning
my @free = `/usr/bin/free`;
$free[1] =~ m/(\d+)/;
my $mem = $1;
$free[2] =~ m/(\d+)/;
my $used = $1;
my $pct = int 100 * ($mem - $used) / $mem;
if ($used / $mem > 90) {
$warnmessage .= " $Lang::tr{'high memory usage'}: $pct% !\n";
}
# Diskspace usage warning
my @temp=();
my $temp2=();
my @df = `/bin/df -B M -x rootfs`;
foreach my $line (@df) {
next if $line =~ m/^Filesystem/;
if ($line =~ m/root/ ) {
$line =~ m/^.* (\d+)M.*$/;
@temp = split(/ +/,$line);
if ($1<5) {
# available:plain value in MB, and not %used as 10% is too much to waste on small disk
# and root size should not vary during time
$warnmessage .= " $Lang::tr{'filesystem full'}: $temp[0] $Lang::tr{'free'}=$1M !\n";
}
} else {
# $line =~ m/^.* (\d+)m.*$/;
$line =~ m/^.* (\d+)\%.*$/;
if ($1>90) {
@temp = split(/ /,$line);
$temp2=int(100-$1);
$warnmessage .= " $Lang::tr{'filesystem full'}: $temp[0] $Lang::tr{'free'}=$temp2% !\n";
}
}
}
if ($warnmessage) {
print "";
}
&Header::closebox();
&Header::closebigbox();
&Header::closepage();
| | | | | | |