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-Tag: v2.15-core80~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4cb523d4626f923f6b499ba99a8cb51f7c37f74b;p=ipfire-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 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;