]> git.ipfire.org Git - people/teissler/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)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jul 2014 10:35:05 +0000 (12:35 +0200)
config/cfgroot/general-functions.pl

index 1ef014a66cf67d303f8a32cf8dd2da5786542d5a..6994f333d5a84c48ed57aa9155b04b34a0c818f5 100644 (file)
@@ -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 = <IFACE>;
+       close(IFACE);
+       chomp $interface;
+
+       return $interface;
+}
+
 1;