summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/pfsense-utils.inc19
1 files changed, 19 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 6c681af..bf53caa 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -3682,4 +3682,23 @@ function get_cpu_speed() {
return exec("sysctl hw.clockrate | awk '{ print $2 }'");
}
+/* check if the wan interface is up
+ * Wait for a maximum of 10 seconds
+ * If the interface is up before then continue
+ */
+function is_wan_interface_up($interface) {
+ global $g;
+ global $config;
+ $i = 0;
+ while($i < 10) {
+ if(get_interface_gateway($interface)) {
+ return true;
+ } else {
+ sleep(1);
+ }
+ $i++;
+ }
+ return false;
+}
+
?>
OpenPOWER on IntegriCloud