use strict;
# enable only the following on debugging purpose
-#use warnings;
-#use CGI::Carp 'fatalsToBrowser';
+use warnings;
+use CGI::Carp 'fatalsToBrowser';
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
&General::readhash("${General::swroot}/ddns/settings", \%ddnssettings);
+my %color = ();
+my %mainsettings = ();
+&General::readhash("${General::swroot}/main/settings", \%mainsettings);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+
my $connstate = &Header::connectionstatus();
if ($connstate =~ /$Lang::tr{'dod waiting'}/ || -e "${General::swroot}/main/refreshindex") {
$refresh = "<meta http-equiv='refresh' content='30;'>";
chomp ($ipaddr);
}
if (open(IPADDR,"${General::swroot}/red/local-ipaddress")) {
- my $ipaddr = <IPADDR>;
+ $ipaddr = <IPADDR>;
close IPADDR;
chomp ($ipaddr);
}
<!-- Table of networks -->
<table border='0' width=80%>
- <tr> <th bgcolor='lightgrey'>$Lang::tr{'network'}
- <th bgcolor='lightgrey'>IP
- <th bgcolor='lightgrey'>$Lang::tr{'status'}
+ <tr> <th bgcolor='$color{'color20'}'>$Lang::tr{'network'}
+ <th bgcolor='$color{'color20'}'>IP
+ <th bgcolor='$color{'color20'}'>$Lang::tr{'status'}
<tr> <td bgcolor='$Header::colourred' width='25%'><a href="/cgi-bin/pppsetup.cgi"><font size='2' color='white'><b>$Lang::tr{'internet'}:</b></font></a><br>
<td width='30%'>$ipaddr
<td width='45%'>$connstate
+END
+print `/usr/local/bin/dialctrl.pl show`;
+print <<END;
<tr><td colspan='2'>
<form method='post' action='/cgi-bin/dial.cgi'>$Lang::tr{'profile'}:
<select name='PROFILE'>
print "$Lang::tr{'profile has errors'}\n </b></font>\n";
}
+ my $HOSTNAME = (gethostbyaddr(pack("C4", split(/\./, $ipaddr)), 2))[0];
+ if ( "$HOSTNAME" ne "" ) {
+ print <<END;
+ <tr><td><b>Hostname:</b><td>$HOSTNAME<td>
+END
+ }
+
+ if ( -e "/var/ipfire/red/remote-ipaddress" ) {
+ my $GATEWAY = `cat /var/ipfire/red/remote-ipaddress`;
+ chomp($GATEWAY);
+ print <<END;
+ <tr><td><b>Gateway:</b><td>$GATEWAY<td>
+END
+ }
+
my $DNS1 = `cat /var/ipfire/red/dns1`;
my $DNS2 = `cat /var/ipfire/red/dns2`;
chomp($DNS1);
}
print <<END;
</table>
+
END
+
&Header::closebox();
&Header::closebigbox();