From: Stefan Schantl Date: Tue, 3 Jun 2014 20:33:18 +0000 (+0200) Subject: general-functions.pl: Add function to get the used interface on red. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8393733c77e51ec2ba69183abd41d93b63c5413;p=people%2Fstevee%2Fipfire-2.x.git general-functions.pl: Add function to get the used interface on red. --- diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 6fabf1c058..7619ec2cf2 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -1174,4 +1174,16 @@ sub firewall_reload() { system("/usr/local/bin/firewallctrl"); } +# Function which will return the used interface for the red network zone (red0, ppp0, etc). +sub get_red_interface() { + + open(IFACE, "${General::swroot}/red/iface") or die "Could not open /var/ipfire/red/iface"; + + my $interface = ; + close(IFACE); + chomp $interface; + + return $interface; +} + 1;