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";
chomp ($ipaddr);
}
if (open(IPADDR,"${General::swroot}/red/local-ipaddress")) {
- my $ipaddr = <IPADDR>;
+ $ipaddr = <IPADDR>;
close IPADDR;
chomp ($ipaddr);
}
<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 "\t<option value='$c' $selected{'PROFILE'}{$c}>$c. $profilenames[$c]</option>\n";
}
}
- $dialButtonDisabled = "disabled='disabled'" if (-e '/var/run/ppp-ipcop.pid' || -e "${General::swroot}/red/active");
+ $dialButtonDisabled = "disabled='disabled'" if (-e '/var/run/ppp-ipfire.pid' || -e "${General::swroot}/red/active");
if ( ( $pppsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ ) ) {
print <<END;
</select>
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);
+ chomp($DNS1);
+
+ if ( $DNS1 ) { print <<END;
+ <tr><td><b>DNS-Server:</b><td>$DNS1
+END
+ }
+ if ( $DNS2 ) { print <<END;
+ <td>$DNS2
+END
+ } else { print <<END;
+ <td>
+END
+ }
+
if ( $netsettings{'GREEN_DEV'} ) { print <<END;
<tr><td bgcolor='$Header::colourgreen' width='25%'><a href="/cgi-bin/dhcp.cgi"><font size='2' color='white'><b>$Lang::tr{'lan'}:</b></font></a>
<td width='30%'>$netsettings{'GREEN_ADDRESS'}
<td width='45%'><font color=$Header::colourgreen>Online</font>
END
}
- if ( $netsettings{'DNS1'} ) { print <<END;
- <tr><td>DNS-Server: <td>$netsettings{'DNS1'}
-END
- }
- if ( $netsettings{'DNS2'} ) { print <<END;
- <td>$netsettings{'DNS2'}
-END
- }
-
# Memory usage warning
my @free = `/usr/bin/free`;
}
print <<END;
</table>
+
END
+
&Header::closebox();
&Header::closebigbox();