- } else {
- $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'connecting'} $profileused</span>";
- }
- }
- } elsif ($netsettings{'RED_TYPE'} eq "STATIC" || $pppsettings {'METHOD'} eq 'STATIC') {
- if (-e "${General::swroot}/red/active") {
- $timestr = &General::age("${General::swroot}/red/active");
- $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'connected'} (<span class='ipcop_StatusBigRed'>$timestr</span>) $profileused</span>";
- } else {
- $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'idle'} $profileused</span>";
- }
- } elsif ( ( (-e "${General::swroot}/dhcpc/dhcpcd-$iface.pid") && $netsettings{'RED_TYPE'} ne 'PPTP' ) ||
- !system("/bin/ps -ef | /bin/grep -q '[p]ppd'") || !system("/bin/ps -ef | /bin/grep -q '[c]onnectioncheck'")) {
- if (-e "${General::swroot}/red/active") {
- $timestr = &General::age("${General::swroot}/red/active");
- if ($pppsettings{'TYPE'} =~ /^(modem|bewanadsl|conexantpciadsl|eagleusbadsl)$/) {
- my $speed;
- if ($pppsettings{'TYPE'} eq 'modem') {
- open(CONNECTLOG, "/var/log/connect.log");
- while (<CONNECTLOG>) {
- if (/CONNECT/) {
- $speed = (split / /)[6];
- }
- }
- close (CONNECTLOG);
- } elsif ($pppsettings{'TYPE'} eq 'bewanadsl') {
- $speed = `/usr/bin/unicorn_status | /bin/grep Rate | /usr/bin/cut -f2 -d ':'`;
- } elsif ($pppsettings{'TYPE'} eq 'conexantpciadsl') {
- $speed = `/bin/cat /proc/net/atm/CnxAdsl:* | /bin/grep 'Line Rates' | /bin/sed -e 's+Line Rates: Receive+Rx+' -e 's+Transmit+Tx+'`;
- } elsif ($pppsettings{'TYPE'} eq 'eagleusbadsl') {
- $speed = `/usr/sbin/eaglestat | /bin/grep Rate`;
- }
- $connstate = "$Lang::tr{'connected'} ($timestr) $profileused (\@$speed)";
- } else {
- $connstate = "$Lang::tr{'connected'} ($timestr) $profileused";
- }
- } else {
- if (-e "${General::swroot}/red/dial-on-demand") {
- $connstate = "$Lang::tr{'dod waiting'} $profileused";
- } else {
- $connstate = "$Lang::tr{'connecting'} $profileused";