]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
general-functions.pl: Add function to get the used interface on red.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 3 Jun 2014 20:33:18 +0000 (22:33 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 22 Jun 2014 09:22:50 +0000 (11:22 +0200)
config/cfgroot/general-functions.pl

index 6fabf1c0583a0c9c2e5fa90f4966028671dffae0..7619ec2cf23ff0e57af20201a9e1a89fda59632f 100644 (file)
@@ -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 = <IFACE>;
+       close(IFACE);
+       chomp $interface;
+
+       return $interface;
+}
+
 1;