diff --git a/classes/LBRY_Daemon.php b/classes/LBRY_Daemon.php
index d54eda9..76e7871 100644
--- a/classes/LBRY_Daemon.php
+++ b/classes/LBRY_Daemon.php
@@ -38,8 +38,9 @@ class LBRY_Daemon
$this->notice = new LBRY_Admin_Notice();
$this->daemon_running = $this->test_daemon();
- if (!$this->daemon_running && !$this->start_daemon()) {
- $this->notice->set_notice('error', 'Cannot connect to the LBRY Daemon. Click HERE for help.');
+ if (!$this->daemon_running) {
+ $this->start_daemon();
+ $this->notice->set_notice('error', 'Cannot connect to the LBRY Daemon. Attempting to start server.
If you are still having troubles, click HERE for help.');
}
}
@@ -60,11 +61,19 @@ class LBRY_Daemon
/**
* Attempts to start the daemon
- * @return bool True on success
*/
private function start_daemon()
{
- return false;
+ $response = popen(ABSPATH . '/lbrynet start', "w");
+ error_log(print_r($response));
+ }
+
+ /**
+ * Attempts to start the daemon
+ */
+ private function stop_daemon()
+ {
+ exec(ABSPATH . '/lbrynet stop &');
}
/**
diff --git a/templates/help_page.php b/templates/help_page.php
index dfe2445..f1d6a77 100644
--- a/templates/help_page.php
+++ b/templates/help_page.php
@@ -9,7 +9,7 @@
By default, `lbrynet` will provide a JSON-RPC server at `http://localhost:5279`. This is the address our plugin will be expecting to use.
+By default, lbrynet
will provide a JSON-RPC server at http://localhost:5279
. This is the address our plugin will be expecting to use.
If curious, The full API is documented here