From edd2710520fb2b762b1b4a05a0a34180ad30b7ae Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 3 Jan 2021 11:16:22 +0000 Subject: [PATCH] Drop unused upnp.cgi Signed-off-by: Michael Tremer --- config/rootfiles/common/web-user-interface | 1 - html/cgi-bin/upnp.cgi | 228 --------------------- 2 files changed, 229 deletions(-) delete mode 100644 html/cgi-bin/upnp.cgi diff --git a/config/rootfiles/common/web-user-interface b/config/rootfiles/common/web-user-interface index 3eac4411af..0aef4a0c22 100644 --- a/config/rootfiles/common/web-user-interface +++ b/config/rootfiles/common/web-user-interface @@ -83,7 +83,6 @@ srv/web/ipfire/cgi-bin/time.cgi #srv/web/ipfire/cgi-bin/tor.cgi srv/web/ipfire/cgi-bin/traffic.cgi srv/web/ipfire/cgi-bin/updatexlrator.cgi -#srv/web/ipfire/cgi-bin/upnp.cgi srv/web/ipfire/cgi-bin/urlfilter.cgi srv/web/ipfire/cgi-bin/vpnmain.cgi srv/web/ipfire/cgi-bin/vulnerabilities.cgi diff --git a/html/cgi-bin/upnp.cgi b/html/cgi-bin/upnp.cgi deleted file mode 100644 index 5d99d0ed70..0000000000 --- a/html/cgi-bin/upnp.cgi +++ /dev/null @@ -1,228 +0,0 @@ -#!/usr/bin/perl -############################################################################### -# # -# IPFire.org - A linux based firewall # -# Copyright (C) 2007 Michael Tremer & Christian Schmidt # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program. If not, see . # -# # -############################################################################### - -use strict; -# enable only the following on debugging purpose -#use warnings; -#use CGI::Carp 'fatalsToBrowser'; - -require '/var/ipfire/general-functions.pl'; -require "${General::swroot}/lang.pl"; -require "${General::swroot}/header.pl"; - -my %upnpsettings = (); -my %netsettings = (); -my $message = ""; -my $errormessage = ""; -my %selected= () ; - -my %servicenames =('UPnP Daemon' => 'upnpd',); - -my %color = (); -my %mainsettings = (); -&General::readhash("${General::swroot}/main/settings", \%mainsettings); -&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color); - -&Header::showhttpheaders(); -############################################################################################################################ -############################################### Setzen von Standartwerten ################################################## - -$upnpsettings{'DEBUGMODE'} = '3'; -$upnpsettings{'FORWARDRULES'} = 'yes'; -$upnpsettings{'DOWNSTREAM'} = '1048576'; -$upnpsettings{'UPSTREAM'} = '131072'; -$upnpsettings{'DESCRIPTION'} = 'gatedesc.xml'; -$upnpsettings{'XML'} = '/etc/linuxigd'; -$upnpsettings{'ENABLED'} = 'off'; -$upnpsettings{'friendlyName'} = 'IPFire Gateway'; -### Values that have to be initialized -$upnpsettings{'ACTION'} = ''; - -&General::readhash("${General::swroot}/upnp/settings", \%upnpsettings); -&General::readhash("${General::swroot}/ethernet/settings", \%netsettings); -&Header::getcgihash(\%upnpsettings); - -&Header::openpage('UPnP', 1, ''); -&Header::openbigbox('100%', 'left', '', $errormessage); - -############################################################################################################################ -################################################### Speichern der Config ################################################### - -if ($upnpsettings{'ACTION'} eq $Lang::tr{'save'}) - { - $upnpsettings{'DOWNSTREAM'} = $upnpsettings{'DOWNSTREAM'} * 1024; - $upnpsettings{'UPSTREAM'} = $upnpsettings{'UPSTREAM'} * 1024; - &General::writehash("${General::swroot}/upnp/settings", \%upnpsettings); - - open (FILE, ">${General::swroot}/upnp/upnpd.conf") or die "Can't save the upnp config: $!"; - flock (FILE, 2); - - print FILE <$errormessage\n"; - print " \n"; - &Header::closebox(); - } - -############################################################################################################################ -############################################################################################################################ - -&Header::openbox('100%', 'center', 'UPnP'); -print < - -END -; -if ( $message ne "" ) {print "";} - -my $lines = 0; -my $key = ''; -foreach $key (sort keys %servicenames) -{ - print "
$message
$key\n"; - my $shortname = $servicenames{$key}; - my $status = &isrunning($shortname); - print "$status\n"; - $lines++; -} - -print <Alle Dienste: - - - -
- -
-
- - - - - - - - - -
$Lang::tr{'options'}

UPnP Device Name:

Downstream in KB:
Upstream in KB:

-
-END -; -&Header::closebox(); - -&Header::openbox('100%', 'center', 'Aktuell geoeffnete Ports'); -my @output = qx(iptables -t nat -n -L PORTFW); -my ($outputline, $extip, $extport, $int); -my @output2; -print ""; -foreach $outputline (@output) { - if ( $outputline =~ /^DNAT/ ) { - @output2 = split(/ /, $outputline); - $extip = $output2[23]; - $extport = $output2[29]; - $extport =~ s/dpt://; - $int = "$output2[31]"; - $int =~ s/to://; - print "
$extip:$extport=>$int"; - - } -} - -print "
"; - -&Header::closebox(); - -&Header::closebigbox(); -&Header::closepage(); - -############################################################################################################################ -############################################################################################################################ - -sub isrunning -{ - my $cmd = $_[0]; - my $status = "$Lang::tr{'stopped'}"; - my $pid = ''; - my $testcmd = ''; - my $exename; - - $cmd =~ /(^[a-z]+)/; - $exename = $1; - - if (open(FILE, "/var/run/${cmd}.pid")) - { - $pid = ; chomp $pid; - close FILE; - if (open(FILE, "/proc/${pid}/status")) - { - while () - {if (/^Name:\W+(.*)/) {$testcmd = $1; }} - close FILE; - if ($testcmd =~ /$exename/) - {$status = "$Lang::tr{'running'}";} - } - } - - return $status; -} - -- 2.39.2