Skip to content

Commit

Permalink
removed script name from required URL
Browse files Browse the repository at this point in the history
  • Loading branch information
instanttim committed Jan 21, 2017
1 parent 8654af8 commit 6e589cf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions Data Stream Relay/monitormate.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
die("$errstr ($errno)");
}

// if the last char is NOT a backslash, then add it.
if (substr_compare($post_URL, "/", strlen($post_URL) - 1) != 0) {
$post_URL = $post_URL."/";
}
$post_URL = $post_URL."post_datastream.php";

do { // main loop
// start each iteration with empty data sets
$post_data_array = array();
Expand Down Expand Up @@ -153,10 +159,10 @@ function print_help() {
print("Usage: php monitormate.php [options]\nOptions:\n\n");
print("\t-a IP_ADDRESS\t\tIP address on which to listen for data stream. (optional, defaults to all)\n");
print("\t-p UDP_PORT\t\tPort Mate3 is configured to use for Data Stream.\n");
print("\t-u URL\t\t\tThe full URL to the post_datastream.php on your webserver.\n");
print("\t-u URL\t\t\tThe URL to your MonitorMate web server installation.\n");
print("\t-t TOKEN\t\tToken configured in config.php on your webserver. (optional, but recommended)\n");
print("\t-d\t\t\tDebug output\n\n");
print("Example: php monitormate.php -a 10.0.0.1 -p 57027 -u http://mydomain.com/monitormate/post_datastream.php\n\n");
print("Example: php monitormate.php -a 10.0.0.1 -p 57027 -u http://mydomain.com/monitormate/\n\n");
}

?>
2 changes: 1 addition & 1 deletion Data Stream Relay/monitormate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
DIR=/usr/local/bin/monitormate
DAEMON=$DIR/monitormate.php
DAEMON_NAME=monitormate
DAEMON_ARG="-a 10.0.1.10 -p 57027 -u http://yourwebsite.com/monitormate/post_datastream.php -t y0urT0k3nG03sH3r3!"
DAEMON_ARG="-p 57027 -u http://yourwebsite.com/monitormate/ -t y0urT0k3nG03sH3r3!"

# This next line determines what user the script runs as.
# Root generally not recommended but necessary if you are using the Raspberry Pi GPIO from Python.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ php monitormate.php -h

-a IP_ADDRESS IP address on which to listen for data stream. (optional, defaults to all)
-p UDP_PORT Port Mate3 is configured to use for Data Stream.
-u URL The full URL to the post_datastream.php on your webserver.
-u URL The URL to your MonitorMate web server installation.
-t TOKEN Token configured in config.php on your webserver. (optional, but recommended)
-d Debug output

Expand Down

0 comments on commit 6e589cf

Please sign in to comment.