|
|
|
@ -324,19 +324,20 @@ function DisplayOpenVPNConfig() {
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
function DisplayTorProxyConfig(){
|
|
|
|
|
/*LOKINET FUNCTIONS ADDED HERE*/
|
|
|
|
|
|
|
|
|
|
function DisplayLokinetConfig(){
|
|
|
|
|
|
|
|
|
|
exec( 'cat '. RASPI_TORPROXY_CONFIG, $return );
|
|
|
|
|
exec( 'pidof tor | wc -l', $torproxystatus);
|
|
|
|
|
exec( 'pidof lokinet | wc -l', $lokinetstatus);
|
|
|
|
|
|
|
|
|
|
if( $torproxystatus[0] == 0 ) {
|
|
|
|
|
$status = '<div class="alert alert-warning alert-dismissable">TOR is not running
|
|
|
|
|
if( $lokinetstatus[0] == 0 ) {
|
|
|
|
|
$status = '<div class="alert alert-warning alert-dismissable">Lokinet daemon is not running
|
|
|
|
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
|
|
|
|
|
} else {
|
|
|
|
|
$status = '<div class="alert alert-success alert-dismissable">TOR is running
|
|
|
|
|
$status = '<div class="alert alert-success alert-dismissable">Lokinet is running
|
|
|
|
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$arrConfig = array();
|
|
|
|
|
foreach( $return as $a ) {
|
|
|
|
|
if( $a[0] != "#" ) {
|
|
|
|
@ -466,55 +467,19 @@ function DisplayTorProxyConfig(){
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
function SaveTORAndVPNConfig(){
|
|
|
|
|
if( isset($_POST['SaveOpenVPNSettings']) ) {
|
|
|
|
|
// TODO
|
|
|
|
|
} elseif( isset($_POST['SaveTORProxySettings']) ) {
|
|
|
|
|
// TODO
|
|
|
|
|
} elseif( isset($_POST['StartOpenVPN']) ) {
|
|
|
|
|
echo "Attempting to start openvpn";
|
|
|
|
|
exec( 'sudo /etc/init.d/openvpn start', $return );
|
|
|
|
|
foreach( $return as $line ) {
|
|
|
|
|
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
} elseif( isset($_POST['StopOpenVPN']) ) {
|
|
|
|
|
echo "Attempting to stop openvpn";
|
|
|
|
|
exec( 'sudo /etc/init.d/openvpn stop', $return );
|
|
|
|
|
foreach( $return as $line ) {
|
|
|
|
|
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
} elseif( isset($_POST['StartTOR']) ) {
|
|
|
|
|
echo "Attempting to start TOR";
|
|
|
|
|
exec( 'sudo /etc/init.d/tor start', $return );
|
|
|
|
|
foreach( $return as $line ) {
|
|
|
|
|
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
} elseif( isset($_POST['StopTOR']) ) {
|
|
|
|
|
echo "Attempting to stop TOR";
|
|
|
|
|
exec( 'sudo /etc/init.d/tor stop', $return );
|
|
|
|
|
foreach( $return as $line ) {
|
|
|
|
|
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
/*LOKINET FUNCTIONS ADDED HERE*/
|
|
|
|
|
|
|
|
|
|
function DisplayLokinetConfig(){
|
|
|
|
|
function DisplayTorProxyConfig(){
|
|
|
|
|
|
|
|
|
|
exec( 'cat '. RASPI_TORPROXY_CONFIG, $return );
|
|
|
|
|
exec( 'pidof lokinet | wc -l', $lokinetstatus);
|
|
|
|
|
exec( 'pidof tor | wc -l', $torproxystatus);
|
|
|
|
|
|
|
|
|
|
if( $lokinetstatus[0] == 0 ) {
|
|
|
|
|
$status = '<div class="alert alert-warning alert-dismissable">Lokinet daemon is not running
|
|
|
|
|
if( $torproxystatus[0] == 0 ) {
|
|
|
|
|
$status = '<div class="alert alert-warning alert-dismissable">TOR is not running
|
|
|
|
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
|
|
|
|
|
} else {
|
|
|
|
|
$status = '<div class="alert alert-success alert-dismissable">Lokinet is running
|
|
|
|
|
$status = '<div class="alert alert-success alert-dismissable">TOR is running
|
|
|
|
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$arrConfig = array();
|
|
|
|
|
foreach( $return as $a ) {
|
|
|
|
|
if( $a[0] != "#" ) {
|
|
|
|
@ -639,4 +604,39 @@ function DisplayLokinetConfig(){
|
|
|
|
|
</div><!-- /.row -->
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
function SaveTORAndVPNConfig(){
|
|
|
|
|
if( isset($_POST['SaveOpenVPNSettings']) ) {
|
|
|
|
|
// TODO
|
|
|
|
|
} elseif( isset($_POST['SaveTORProxySettings']) ) {
|
|
|
|
|
// TODO
|
|
|
|
|
} elseif( isset($_POST['StartOpenVPN']) ) {
|
|
|
|
|
echo "Attempting to start openvpn";
|
|
|
|
|
exec( 'sudo /etc/init.d/openvpn start', $return );
|
|
|
|
|
foreach( $return as $line ) {
|
|
|
|
|
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
} elseif( isset($_POST['StopOpenVPN']) ) {
|
|
|
|
|
echo "Attempting to stop openvpn";
|
|
|
|
|
exec( 'sudo /etc/init.d/openvpn stop', $return );
|
|
|
|
|
foreach( $return as $line ) {
|
|
|
|
|
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
} elseif( isset($_POST['StartTOR']) ) {
|
|
|
|
|
echo "Attempting to start TOR";
|
|
|
|
|
exec( 'sudo /etc/init.d/tor start', $return );
|
|
|
|
|
foreach( $return as $line ) {
|
|
|
|
|
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
} elseif( isset($_POST['StopTOR']) ) {
|
|
|
|
|
echo "Attempting to stop TOR";
|
|
|
|
|
exec( 'sudo /etc/init.d/tor stop', $return );
|
|
|
|
|
foreach( $return as $line ) {
|
|
|
|
|
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|