diff --git a/includes/functions.php b/includes/functions.php
index d2aaa083..1c4c5150 100755
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -266,184 +266,6 @@ function ConvertToSecurity($security)
}
}
-/**
-*
-*
-*/
-function DisplayTorProxyConfig()
-{
-
- exec('cat '. RASPI_TORPROXY_CONFIG, $return);
- exec('pidof tor | wc -l', $torproxystatus);
-
- if ($torproxystatus[0] == 0) {
- $status = '
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Relay settings
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ' , PHP_EOL;
- } else {
- echo '
' , PHP_EOL;
- };
- ?>
-
-
-
-
-
-
- ' , 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).'
' , 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).'
' , 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).'
' , PHP_EOL;
- }
- }
-}
-
/**
* Renders a simple PHP template
*/
diff --git a/includes/openvpn.php b/includes/openvpn.php
index a7573dba..75e90216 100644
--- a/includes/openvpn.php
+++ b/includes/openvpn.php
@@ -33,5 +33,32 @@ function DisplayOpenVPNConfig()
"status",
"openvpnStatus"
));
+
}
+/**
+*
+*
+*/
+function SaveOpenVPNConfig()
+{
+ if (isset($_POST['SaveOpenVPNSettings'])) {
+ // TODO
+ } elseif (isset($_POST['StartOpenVPN'])) {
+ echo "Attempting to start openvpn";
+ exec('sudo systemctl start openvpn.service', $return);
+ foreach ($return as $line) {
+ $status->addMessage($line, 'info');
+ }
+ } elseif (isset($_POST['StopOpenVPN'])) {
+ echo "Attempting to stop openvpn";
+ exec('sudo systemctl stop openvpn.service', $return);
+ foreach ($return as $line) {
+ $status->addMessage($line, 'info');
+ }
+ }
+}
+?>
+
+
+
diff --git a/includes/torproxy.php b/includes/torproxy.php
new file mode 100644
index 00000000..cafbaa10
--- /dev/null
+++ b/includes/torproxy.php
@@ -0,0 +1,52 @@
+addMessage($line, 'info');
+ }
+ } elseif (isset($_POST['StopTOR'])) {
+ echo "Attempting to stop TOR";
+ exec('sudo systemctl stop tor.service', $return);
+ foreach ($return as $line) {
+ $status->addMessage($line, 'info');
+ }
+ }
+}
+?>
diff --git a/templates/torproxy.php b/templates/torproxy.php
new file mode 100644
index 00000000..a7e1196d
--- /dev/null
+++ b/templates/torproxy.php
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Relay settings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ' , PHP_EOL;
+ } else {
+ echo '
' , PHP_EOL;
+ };
+ ?>
+
+
+
+
+
+
+