From 4cb523d4626f923f6b499ba99a8cb51f7c37f74b 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 1ef014a66c..6994f333d5 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -1187,4 +1187,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.2