From 73a16c428f0fee1975a002a9baa14e8c4ea4c637 Mon Sep 17 00:00:00 2001 From: glen Date: Sat, 3 Oct 2020 14:47:17 -0400 Subject: [PATCH] Add initial exit functionality to GUI. --- includes/functions.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index ac0d525..555ec29 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -379,7 +379,7 @@ function DisplayLokinetConfig()
' , PHP_EOL; } else { echo '' , PHP_EOL; @@ -394,9 +394,9 @@ function DisplayLokinetConfig()

Lokient Daemon

-
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. +
-
+
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$
@@ -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 "
$output
"; + + //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'])) { ?>