Add initial exit functionality to GUI.

pull/38/head
glen 4 years ago
parent 471615ebfa
commit 73a16c428f

@ -379,7 +379,7 @@ function DisplayLokinetConfig()
<input type="url" class="form-control" placeholder="enter exit key here" id="exitkey" name="exitkey">
<br/>
<?php
if ($exitstatus[0] == 0) {
if ($exitstatus == False) {
echo '<input type="submit" class="btn btn-success" name="StartExit" value="Start Exit" />' , PHP_EOL;
} else {
echo '<input type="submit" class="btn btn-danger" name="StopExit" value="Stop Exit" />' , PHP_EOL;
@ -394,9 +394,9 @@ function DisplayLokinetConfig()
<div class="tab-pane fade" id="daemon">
<h4>Lokient Daemon</h4>
<div class="row">
<div class="col-lg-12">The 3 buttons below must be armed (red) to connect to Lokinet. If there isn't a current lokinet.ini file found on the system the "Generate.ini" button will be green. The .ini file must be generated prior to connecting to Lokinet by pressing the button which will automatically write the required .ini file. Similarly the absense of a valid bootstrap will be indicated by a green "Bootstrap" button. Applying a bootstrap by pressing the apply button without submitting a valid URL in the textbox area will apply the original default bootstrap in place of one being provided. Stopping the daemon also exits Lokinet. To summarize, if necessary generate the .ini and bootstrap Lokinet then you are able to connect to Lokinet by starting the daemon and letting the network establish itself.
<div class="col-lg-12">
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#instruct">Instructions</button>
<div id="instruct" class="collapse">
<div id="instruct" class="collapse">The 3 buttons below must be armed (red) to connect to Lokinet. If there isn't a current lokinet.ini file found on the system the "Generate.ini" button will be gre$
</div>
<div class="row">
<div class="form-group col-lg-12">
@ -623,6 +623,22 @@ function SaveTORAndVPNConfig()
} elseif (isset($_POST['StopDaemon'])) {
exec('sudo /var/lib/lokinet/lokilaunch.sh stop');
//START EXIT
} elseif (isset($_POST['StartExit'])) {
$exit = $_POST['exitaddress'];
$token = $_POST['exitkey'];
$exit=str_replace("'", "", $exit);
$token=str_replace("'", "", $token);
$output = shell_exec("sudo /var/lib/lokinet/lokilaunch.sh exitup '".$exit."''" .$token."'");
echo "<pre><strong>$output</strong></pre>";
//exec ('sudo /var/lib/lokinet/lokilaunch.sh exitup');
$exitstatus = True;
//STOP EXIT
} elseif (isset($_POST['StopExit'])) {
exec ('sudo /var/lib/lokinet/lokilaunch.sh exitdown');
$exitstatus = False;
//GENERATE LOKINET.INI
} elseif (isset($_POST['GenerateLokinet'])) {
?>

Loading…
Cancel
Save