diff options
-rw-r--r-- | blaears.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/blaears.php b/blaears.php index 66d6b29..0e0c850 100644 --- a/blaears.php +++ b/blaears.php @@ -1,15 +1,22 @@ <?php +$notset = 0; + if (isset($_POST['url']) && isset($_POST['channel'])) { $url = $_POST['url']; $channel = preg_replace("/[^a-zA-Z0-9:\/\.]/", "", $_POST['channel']); $cmd = "echo -e \"" . $channel . "\nNew file uploaded: " . $url . "\" | /home/smsd/core/msgrelay.bash"; } else { + $notset = 1; $cmd = "echo -e \"theblueroom\nblaears-php received something but it did not have a url and a channel set.\" | /home/smsd/core/msgrelay.bash"; } +file_put_contents('post.txt', "Timestamp: " . date('Y/m/d H:i:s') . " " . date('T') . "\n", FILE_APPEND); +file_put_contents('post.txt', "Remote IP: " . $_SERVER['REMOTE_ADDR'] . "\n", FILE_APPEND); file_put_contents('post.txt', "Command: " . $cmd . "\n", FILE_APPEND); -exec($cmd, $output, $retval); +if (!$notset) { + exec($cmd, $output, $retval); +} file_put_contents('post.txt', "Output: " . print_r($output, true), FILE_APPEND); file_put_contents('post.txt', "Retval: " . $retval . "\n", FILE_APPEND); ?> |