Updating index to support cli and web

This commit is contained in:
Mikki Sørensen 2018-03-10 01:41:52 +01:00
parent 288d5c6477
commit 5545fb78f7

View File

@ -1,24 +1,17 @@
<?php <?php
if (isset($_POST["conf"]) && $_POST["conf"] == "unbound") require_once "lib/include.php";
if (is_cli() === true)
{ {
require "unbound_conf.php"; // Running in cli (commandline)
$unbound_conf = new unbound_conf(); $cli_mode = new cli_mode();
$unbound_conf->print();
} }
else else
{ {
?> // Running in web interface for hosting
$web_mode = new web_mode();
<form action="/steamcache/scripts/" method="post">
<input type="text" name="ip" placeholder="ip of cache server"><br>
<input type="radio" name="conf" value="unbound" checked> unbound<br>
<input type="radio" name="conf" value="other"> Other<br>
<input type="radio" name="conf" value="other2"> Other2<br>
<input type="submit" value="Submit">
</form>
<?php
} }
?> ?>