From: Michael Tremer Date: Mon, 17 Mar 2014 13:17:44 +0000 (+0100) Subject: dialctrl: Remove defunct script. X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=2a07aa9d9c4c1968a1072147107d889a1a8aae5e dialctrl: Remove defunct script. --- diff --git a/config/cron/crontab b/config/cron/crontab index 3b70df44e..92c3a78ba 100644 --- a/config/cron/crontab +++ b/config/cron/crontab @@ -50,9 +50,6 @@ HOME=/ %weekly * 3-5 /var/ipfire/updatexlrator/autocheck/cron.weekly %monthly * 3-5 * /var/ipfire/updatexlrator/autocheck/cron.monthly -# Reset Dialup Statistics -&bootrun 0 0 1 * * /usr/local/bin/dialctrl.pl reset - # fireinfo %nightly,random * 23-4 /usr/bin/sendprofile >/dev/null 2>&1 diff --git a/config/rootfiles/common/armv5tel/initscripts b/config/rootfiles/common/armv5tel/initscripts index bf4dd529a..4716b9726 100644 --- a/config/rootfiles/common/armv5tel/initscripts +++ b/config/rootfiles/common/armv5tel/initscripts @@ -74,7 +74,6 @@ etc/rc.d/init.d/networking/red.down/10-ipsec etc/rc.d/init.d/networking/red.down/10-miniupnpd etc/rc.d/init.d/networking/red.down/10-ovpn etc/rc.d/init.d/networking/red.down/20-RL-firewall -etc/rc.d/init.d/networking/red.down/99-D-dialctrl.pl #etc/rc.d/init.d/networking/red.up etc/rc.d/init.d/networking/red.up/01-conntrack-cleanup etc/rc.d/init.d/networking/red.up/05-RS-dnsmasq @@ -89,7 +88,6 @@ etc/rc.d/init.d/networking/red.up/40-ipac etc/rc.d/init.d/networking/red.up/50-ipsec etc/rc.d/init.d/networking/red.up/50-ovpn etc/rc.d/init.d/networking/red.up/98-leds -etc/rc.d/init.d/networking/red.up/99-U-dialctrl.pl etc/rc.d/init.d/networking/red.up/99-fireinfo etc/rc.d/init.d/networking/red.up/99-pakfire-update etc/rc.d/init.d/networking/wpa_supplicant.exe diff --git a/config/rootfiles/common/i586/initscripts b/config/rootfiles/common/i586/initscripts index 3b91181d0..07a39f463 100644 --- a/config/rootfiles/common/i586/initscripts +++ b/config/rootfiles/common/i586/initscripts @@ -76,7 +76,6 @@ etc/rc.d/init.d/networking/red.down/10-ipsec etc/rc.d/init.d/networking/red.down/10-miniupnpd etc/rc.d/init.d/networking/red.down/10-ovpn etc/rc.d/init.d/networking/red.down/20-RL-firewall -etc/rc.d/init.d/networking/red.down/99-D-dialctrl.pl #etc/rc.d/init.d/networking/red.up etc/rc.d/init.d/networking/red.up/01-conntrack-cleanup etc/rc.d/init.d/networking/red.up/05-RS-dnsmasq @@ -91,7 +90,6 @@ etc/rc.d/init.d/networking/red.up/40-ipac etc/rc.d/init.d/networking/red.up/50-ipsec etc/rc.d/init.d/networking/red.up/50-ovpn etc/rc.d/init.d/networking/red.up/98-leds -etc/rc.d/init.d/networking/red.up/99-U-dialctrl.pl etc/rc.d/init.d/networking/red.up/99-fireinfo etc/rc.d/init.d/networking/red.up/99-pakfire-update etc/rc.d/init.d/networking/wpa_supplicant.exe diff --git a/config/rootfiles/common/stage2 b/config/rootfiles/common/stage2 index a2b1cfab4..87649e972 100644 --- a/config/rootfiles/common/stage2 +++ b/config/rootfiles/common/stage2 @@ -81,7 +81,6 @@ usr/local/bin/backupiso usr/local/bin/connscheduler usr/local/bin/consort.sh usr/local/bin/convert-ovpn -usr/local/bin/dialctrl.pl usr/local/bin/hddshutdown usr/local/bin/httpscert usr/local/bin/makegraphs diff --git a/config/rootfiles/core/76/update.sh b/config/rootfiles/core/76/update.sh index 150045bfe..43c4c3f07 100644 --- a/config/rootfiles/core/76/update.sh +++ b/config/rootfiles/core/76/update.sh @@ -110,6 +110,9 @@ add_to_backup var/ipfire/{dmzholes,portfw,outgoing,xtaccess} add_to_backup etc/inittab add_to_backup etc/fstab add_to_backup usr/share/usb_modeswitch +add_to_backup etc/rc.d/init.d/networking/red.down/99-D-dialctrl.pl +add_to_backup etc/rc.d/init.d/networking/red.up/99-U-dialctrl.pl +add_to_backup usr/local/bin/dialctrl.pl # Backup the files tar cJvf /var/ipfire/backup/core-upgrade${core}_${KVER}.tar.xz \ @@ -141,6 +144,12 @@ rm -rf /lib/modules # Remove old usb_modeswitch_data rm -rf /usr/share/usb_modeswitch +# Remove dialctrl.pl script +rm -f \ + /etc/rc.d/init.d/networking/red.down/99-D-dialctrl.pl \ + /etc/rc.d/init.d/networking/red.up/99-U-dialctrl.pl \ + /usr/local/bin/dialctrl.pl + # # Remove old udev rules. # diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi index 2ce403001..53adeacce 100644 --- a/html/cgi-bin/index.cgi +++ b/html/cgi-bin/index.cgi @@ -228,8 +228,6 @@ END #Dial profiles if ( $netsettings{'RED_TYPE'} ne "STATIC" && $netsettings{'RED_TYPE'} ne "DHCP" ){ - # The dialctrl.pl script outputs html - print `/usr/local/bin/dialctrl.pl show`; if ( ( $pppsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ ) ) { print < diff --git a/lfs/initscripts b/lfs/initscripts index 28387f349..02f97431a 100644 --- a/lfs/initscripts +++ b/lfs/initscripts @@ -185,13 +185,9 @@ $(TARGET) : /etc/rc.d/init.d/networking/red.up/23-RS-snort ln -sf ../../../../../usr/local/bin/qosctrl \ /etc/rc.d/init.d/networking/red.up/24-RS-qos - ln -sf ../../../../../usr/local/bin/dialctrl.pl \ - /etc/rc.d/init.d/networking/red.up/99-U-dialctrl.pl ln -sf ../../squid /etc/rc.d/init.d/networking/red.up/27-RS-squid ln -sf ../../dnsmasq /etc/rc.d/init.d/networking/red.down/05-RS-dnsmasq ln -sf ../../firewall /etc/rc.d/init.d/networking/red.down/20-RL-firewall - ln -sf ../../../../../usr/local/bin/dialctrl.pl \ - /etc/rc.d/init.d/networking/red.down/99-D-dialctrl.pl for i in green blue orange; do \ ln -sf any /etc/rc.d/init.d/networking/$$i; \ diff --git a/src/scripts/dialctrl.pl b/src/scripts/dialctrl.pl deleted file mode 100644 index b0abab7b1..000000000 --- a/src/scripts/dialctrl.pl +++ /dev/null @@ -1,201 +0,0 @@ -#!/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 = ; - ($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 = ; - ($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 = ; - ($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 = ; - ($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 <$Lang::tr{'since'} $update - - - -
$Lang::tr{'connections'}: $up$Lang::tr{'disconnects'}: $down$Lang::tr{'attemps'}: $rec
$Lang::tr{'total connection time'}:$current ~ $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); -}