From c8393733c77e51ec2ba69183abd41d93b63c5413 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Tue, 3 Jun 2014 22:33:18 +0200 Subject: [PATCH] general-functions.pl: Add function to get the used interface on red. --- config/cfgroot/general-functions.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; -- 2.39.5