mail:x:8:12:mail:/var/spool/mail:/bin/false
squid:x:23:23:ftp:/var/spool/squid:/bin/false
ntp:x:38:38::/etc/ntp:/bin/false
+mysql:x:41:41:MySQL Server:/dev/null:/bin/false
+rsyncd:x:48:48:rsyncd Daemon:/home/rsync:/bin/false
sshd:x:74:74:sshd:/var/empty:/bin/false
nobody:x:99:99:Nobody:/home/nobody:/bin/false
+postfix:x:100:100::/var/spool/postfix:/bin/false
snort:x:101:101:ftp:/var/log/snort:/bin/false
logwatch:x:102:102::/var/log/logwatch:/bin/false
dnsmasq:x:103:103::/:/bin/false
cron:x:104:104::/:/bin/false
syslogd:x:105:105:/var/empty:/bin/false
klogd:x:106:106:/var/empty:/bin/false
-postfix:x:100:100::/var/spool/postfix:/bin/false
clamav:x:109:109:Clam AntiVirus:/home/clamav:/bin/false
-rsyncd:x:48:48:rsyncd Daemon:/home/rsync:/bin/false
amavis:x:110:110:Amavisd-new user:/var/amavis:
cyrus:x:111:12:Cyrus user:/usr/cyrus:
filter:x:112:12:Spam user:/home/filter:/bin/false
mldonkey:x:113:111:Mldonkey user:/opt/mldonkey:/bin/false
-mysql:x:41:41:MySQL Server:/dev/null:/bin/false
+samba:x:1000:1000:Samba User:/var/empty:/bin/false
'archive not exist' => 'Konfigurationsarchiv existiert nicht',
'are you sure' => 'Sind Sie sicher?',
'arp table entries' => 'Einträge der ARP-Tabelle:',
+'attemps' => 'Versuche',
'august' => 'August',
'authentication' => 'Authentifizierung:',
'automatic' => 'Automatisch',
'directory mask' => 'UNIX Verzeichnis Rechte',
'directory writeable' => 'Verzeichnis schreibbar',
'disconnect' => 'OVPN Stop / Trennen',
+'disconnects' => 'Abbrüche',
'disk access per' => 'Plattenzugriff je',
'disk usage' => 'Festplattenbelegung:',
'display' => 'Anzeige',
'shutdown2' => 'Herunterfahren:',
'shutting down' => 'Fahre herunter',
'shutting down ipfire' => 'Fahre IPFire herunter',
+'since' => 'seit',
'sitekey' => 'Sitekey',
'sitekeyfile' => 'Sitekeyfile',
'size' => 'Größe',
'archive not exist' => 'Configuration archive does not exist',
'are you sure' => 'Are you sure?',
'arp table entries' => 'ARP Table Entries:',
+'attemps' => 'Attempts',
'august' => 'August',
'authentication' => 'Authentication:',
'automatic' => 'Automatic',
'directory mask' => 'UNIX directory rights',
'directory writeable' => 'directory writeable',
'disconnect' => 'OVPN Stop / Disconnect',
+'disconnects' => 'Disconnects',
'disk access per' => 'Disk Access per',
'disk usage' => 'Disk usage:',
'display' => 'Display',
'shutdown2' => 'Shutdown:',
'shutting down' => 'Shutting down',
'shutting down ipfire' => 'Shutting down IPFire',
+'since' => 'since',
'sitekey' => 'Sitekey',
'sitekeyfile' => 'Sitekeyfile',
'size' => 'Size',
--- /dev/null
+#!/usr/bin/perl
+#
+# Dialup Statistics for IPFire
+# based on SilverStar's work on
+# http://goodymuc.go.funpic.de
+#
+
+require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/lang.pl";
+require "${General::swroot}/header.pl";
+
+($sec,$min,$hour,$mday,$mon,$year,$wday,$ydat,$isdst)=localtime();
+ $jahr=$year;
+ $monat=$mon+1;
+ $tag=$mday;
+ $jahr=$year;
+
+$jahr=$year +1900;
+
+if (length($monat) == 1)
+{
+ $monat="0$monat";
+}
+if(length($tag) == 1)
+{
+ $tag="0$tag";
+}
+if(length($hour) == 1)
+{
+ $hour="0$hour";
+}
+if(length($min) == 1)
+{
+ $min="0$min";
+}
+if(length($sec) == 1)
+{
+ $sec="0$sec";
+}
+
+my $s_date = $tag."/".$monat."/".$jahr;
+my $s_time = $hour.":".$min.":".$sec;
+my $file_log = "/var/log/counter/dialup.log";
+my $file_connect = "/var/log/counter/connect";
+my $file_reset = "/var/log/counter/reset";
+
+if ($ARGV[0] eq 'up') {
+ if (! -e "$file_log") {
+ &new;
+ } else {
+ open(CONNECT,">$file_connect");
+ close(CONNECT);
+ open(COUNTER,"<$file_log");
+ $line = <COUNTER>;
+ ($start,$update,$up,$down,$rec,$on,$bit) = split(/\|/,$line);
+ close(COUNTER);
+ $up++;
+ $update = $s_date." on ".$s_time;
+ open(COUNTER,">$file_log");
+ print COUNTER "$start\|$update\|$up\|$down\|$rec\|$on\|$bit";
+ close(COUNTER);
+ }
+}
+
+if ($ARGV[0] eq 'down') {
+ if (! -e "$file_log") {
+ &new;
+ } else {
+ open(COUNTER,"<$file_log");
+ $line = <COUNTER>;
+ ($start,$update,$up,$down,$rec,$on,$bit) = split(/\|/,$line);
+ close(COUNTER);
+ $on =~ /(\d+)d\s+(\d+)h\s+(\d+)m\s+(\d+)s/;
+ $d1 = $1; $h1 = $2; $m1 = $3; $s1 = $4;
+ $con = &General::age("$file_connect");
+ $con =~ /(\d+)d\s+(\d+)h\s+(\d+)m\s+(\d+)s/;
+ $d2 = $1; $h2 = $2; $m2 = $3; $s2 = $4;
+ $sum_d = ($d1 + $d2) * 86400;
+ $sum_h = ($h1 + $h2) * 3600;
+ $sum_m = ($m1 + $m2) * 60;
+ $sum_s = ($s1 + $s2);
+ $sum_1 = $sum_d + $sum_h + $sum_m + $sum_s;
+ $d = int($sum_1 / 86400);
+ $totalhours = int($sum_1 / 3600);
+ $h = $totalhours % 24;
+ $totalmins = int($sum_1 / 60);
+ $m = $totalmins % 60;
+ $s = $sum_1 % 60;
+ $on = "${d}d ${h}h ${m}m ${s}s";
+ $down++;
+ $update = $s_date." on ".$s_time;
+ open(COUNTER,">$file_log");
+ print COUNTER "$start\|$update\|$up\|$down\|$rec\|$on\|$bit";
+ close(COUNTER);
+ }
+}
+
+if ($ARGV[0] eq 'rec') {
+ if (! -e "$file_log") {
+ &new;
+ } else {
+ open(COUNTER,"<$file_log");
+ $line = <COUNTER>;
+ ($start,$update,$up,$down,$rec,$on,$bit) = split(/\|/,$line);
+ close(COUNTER);
+ $rec++;
+ $update = $s_date." on ".$s_time;
+ open(COUNTER,">$file_log");
+ print COUNTER "$start\|$update\|$up\|$down\|$rec\|$on\|$bit";
+ close(COUNTER);
+ }
+}
+
+elsif ($ARGV[0] eq 'show') {
+if (! -e "$file_log") {
+ &new;
+ }
+else {
+ open(COUNTER,"<$file_log");
+ $line = <COUNTER>;
+ ($start,$update,$up,$down,$rec,$on,$bit) = split(/\|/,$line);
+ $on =~ /(\d+)d\s+(\d+)h\s+(\d+)m\s+(\d+)s/;
+ $d1 = $1; $h1 = $2; $m1 = $3; $s1 = $4;
+ close(COUNTER);
+ if ( ! -e "${General::swroot}/red/active") {
+ $timecon = "0d 0h 0m 0s";
+ } else {
+ $timecon = &General::age("$file_connect");
+ }
+ $timecon =~ /(\d+)d\s+(\d+)h\s+(\d+)m\s+(\d+)s/;
+ $d2 = $1; $h2 = $2; $m2 = $3; $s2 = $4;
+ $timeres = &General::age("$file_reset");
+ $timeres =~ /(\d+)d\s+(\d+)h\s+(\d+)m\s+(\d+)s/;
+ $d3 = $1; $h3 = $2; $m3 = $3; $s3 = $4;
+ $sum_d1 = ($d1 + $d2) * 86400;
+ $sum_h1 = ($h1 + $h2) * 3600;
+ $sum_m1 = ($m1 + $m2) * 60;
+ $sum_s1 = ($s1 + $s2);
+ $sum_1 = $sum_d1 + $sum_h1 + $sum_m1 + $sum_s1;
+ $sum_d2 = $d3 * 86400;
+ $sum_h2 = $h3 * 3600;
+ $sum_m2 = $m3 * 60;
+ $sum_s2 = $s3;
+ $sum_2 = $sum_d2 + $sum_h2 + $sum_m2 + $sum_s2;
+ $d = int($sum_1 / 86400);
+ $totalhours = int($sum_1 / 3600);
+ $h = $totalhours % 24;
+ $totalmins = int($sum_1 / 60);
+ $m = $totalmins % 60;
+ $s = $sum_1 % 60;
+ $current = "${d}d ${h}h ${m}m ${s}s";
+ $ontime = ( $sum_1 * 100 ) / $sum_2;
+ if ($ontime >= 99.95) {
+ $ontime = sprintf("%.0f", $ontime);
+ }
+ elsif ($ontime <= 0.05) {
+ $ontime = sprintf("%.0f", $ontime);
+ }
+ else {
+ $ontime = sprintf("%.1f", $ontime);
+ }
+
+print <<END
+<br />$Lang::tr{'since'} $start
+<tr><td colspan='3' align='center'>$Lang::tr{'connections'}: $up | $Lang::tr{'disconnects'}: $down | $Lang::tr{'attemps'}: $rec
+<tr><td><b>Verbindungszeit:</b><td align='right'>$current<td align='left'> ~ $ontime%
+END
+;
+ }
+}
+
+elsif ($ARGV[0] eq 'reset') {
+ &new;
+}
+
+elsif ($ARGV[0] eq '') {
+ print "\nDont run on the console...\n\n";
+}
+
+exit 0;
+
+sub new {
+ open(COUNTER,">$file_log");
+ $start = $s_date." on ".$s_time;
+ $update = "‹no action since clearing›";
+ $up = "0";
+ $down = "0";
+ $rec = "0";
+ $on = "0d 0h 0m";
+ $bit = "0";
+ print COUNTER "$start\|$update\|$up\|$down\|$rec\|$on\|$bit";
+ close(COUNTER);
+ open(CONNECT,">$file_connect");
+ print CONNECT "0";
+ close(CONNECT);
+ open(RESET,">$file_reset");
+ print RESET "0";
+ close(RESET);
+}