]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - config/cfgroot/general-functions.pl
general-functions.pl: Add function to get the used interface on red.
[people/teissler/ipfire-2.x.git] / 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;