Created
March 4, 2011 20:11
-
-
Save gavinblair/855627 to your computer and use it in GitHub Desktop.
Minecraft Server Message command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
unset($argv[0]); | |
$message = implode(" ", $argv); | |
shell_exec("curl -d '{\"name\":\"SERVER\",\"message\":\"$message\"}' http://10.0.1.104:80/up/sendmessage"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php msg.php $* |
Yep, I would aggree with StuartClark on this one... did you try that?
Sorry I accidently deleted what I suggested.
Try ./msg.sh "Hello this is the ADMIN"
with quotes
Didn't work. The problem is the embedded quotation marks in the script.
You can test it out using http://198.20.49.65:1337/up/sendmessage as the last part of the line, and visiting http://198.20.49.65:1337/ to see the result.
They can't speak back to me though...
Why are you using the command line rather than php's curl?
Way easier, especially since I am not expecting anything back from the server. Takes a minimum of 3 lines of code to do PHP's cURL.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't work.
./msg.sh Hello this is the ADMIN
only sends the first word, "Hello". What do?