Clean up bootstrap PHP.

pull/28/head
necro-nemesis 5 years ago
parent 997d841bf7
commit 97a3aa106b

@ -596,64 +596,70 @@ function SaveTORAndVPNConfig()
foreach ($return as $line) {
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
}
/* Lokinet script commands start HERE
////
//// LOKINET
////
//*/
//START
} elseif (isset($_POST['StartDaemon'])) {
?>
?>
<div class="alert alert-success">
Launching Lokinet.
Launching Lokinet.
</div>
<?php
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh start');
echo "<pre><strong>$output</strong></pre>";
echo "<pre><strong>$output</strong></pre>";
//STOP
} elseif (isset($_POST['StopDaemon'])) {
?>
?>
<div class="alert alert-danger">
Exiting Lokinet.
Exiting Lokinet.
</div>
<?php
?>
<div class="alert alert-danger">
Stopping Lokinet background daemon process.
Stopping Lokinet background daemon process.
</div>
<?php
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh stop');
echo "<pre><strong>$output</strong></pre>";
echo "<pre><strong>$output</strong></pre>";
//GENERATE LOKINET.INI
} elseif (isset($_POST['GenerateLokinet'])) {
?>
?>
<div class="alert alert-success">
Generating Lokinet Configuration
Generating Lokinet Configuration
</div>
<?php
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh gen');
echo "<pre><strong>$output</strong></pre>";
echo "<pre><strong>$output</strong></pre>";
//REGENERATE LOKINET.INI
} elseif (isset($_POST['ReGenerateLokinet'])) {
?>
?>
<div class="alert alert-success">
Regenerating Lokinet Configuration
Regenerating Lokinet Configuration
</div>
<?php
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh gen');
echo "<pre><strong>$output</strong></pre>";
echo "<pre><strong>$output</strong></pre>";
//APPLY LOKINET-BOOTSTRAP
} elseif (isset($_POST['ApplyLokinetSettings'])) {
?>
<div class="alert alert-danger">
Exiting Lokinet.
</div>
<?php
?>
<div class="alert alert-danger">
?>
<div class="alert alert-danger">
Stopping Lokinet background daemon process.
</div>
<?php
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh stop');
echo "<pre><strong>$output</strong></pre>";
$bootstrap = $_POST['lokinetbootstrap'];
?>
<div class="alert alert-success">
</div>
<div class="alert alert-success">
Applying Bootstrap
</div>
<?php
$bootstrap=str_replace("'", "", $bootstrap);
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh bootstrap '.$bootstrap.'');
</div>
<?php
$bootstrap = $_POST['lokinetbootstrap'];
$bootstrap=str_replace("'", "", $bootstrap);
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh bootstrap '.$bootstrap.'');
echo "<pre><strong>$output</strong></pre>";
}
}

Loading…
Cancel
Save