summaryrefslogtreecommitdiff
path: root/blaears.php
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2025-02-01 18:19:14 +0000
committerLuke Bratch <luke@bratch.co.uk>2025-02-01 18:19:14 +0000
commitead39a0fd68f88c6c7387997d95261b229af2fc0 (patch)
tree08f7827e3f5d3c49b873bbc9e3de9c6e6422f8a9 /blaears.php
Initial commit.HEADmaster
Diffstat (limited to 'blaears.php')
-rw-r--r--blaears.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/blaears.php b/blaears.php
new file mode 100644
index 0000000..66d6b29
--- /dev/null
+++ b/blaears.php
@@ -0,0 +1,15 @@
+<?php
+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 {
+ $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', "Command: " . $cmd . "\n", FILE_APPEND);
+
+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);
+?>