summaryrefslogtreecommitdiff
path: root/blaears.php
blob: 66d6b297caada233b091c76e7cdb543c66c6ce7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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);
?>