diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 4381c78061..aa696c10c2 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1046,12 +1046,15 @@ EOD; /* fire up mpd */ mwexec("/usr/local/sbin/mpd -b -d {$g['varetc_path']} -p {$g['varrun_path']}/mpd.pid pppoe"); - /* sleep until wan is up */ - while(!file_exists("{$g['tmp_path']}/wanup")) { - sleep(1); - } - unlink_if_exists("{$g['tmp_path']}/wanup"); - + /* sleep until wan is up - or 30 seconds, whichever comes first */ + for ($count = 0; $count < 30; $count++) { + if(file_exists("{$g['tmp_path']}/wanup")) { + break; + } + + sleep(1); + } + unlink_if_exists("{$g['tmp_path']}/wanup"); return 0; }