<?php

$reloadTime = 30; // default to 30 seconds

$redirectUrl = file_get_contents('redirect_url.txt');

if (isset($_GET['SSID'])) {
  include('func/connect.php');
  $reloadTime = 120;
  header('Refresh: '.$reloadTime.';');
  die();
}

// include nic check
include("func/nic.php");

if ($isNetworked && $hasInternet) {  // No network, connect wifi
  header('Refresh: '.$reloadTime.'; '.$redirectUrl);
} else if ($isNetworked && !$hasInternet) {
  header('Refresh: '.$reloadTime.';');
} else {
  $reloadTime = 45;
  header('Refresh: '.$reloadTime.';');
}
include('func/tpl_netsplash.php');
?>
