Created
January 11, 2012 15:02
-
-
Save okossuth/1595073 to your computer and use it in GitHub Desktop.
This file contains 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
if (isset($_POST['command'])) | |
{ | |
echo 'Command: ' . $_POST['command'] . '<br>'; | |
echo 'Container: ' . $_POST['container'] . '<br>'; | |
//if(preg_match("/#/",$_POST['command'])) | |
//{ | |
//cmd = ''; | |
//} else { | |
$cmd = '/usr/local/bin/rackspace-dir.py store --container=' . $_POST['container']' + --path=' . $_POST['command']; | |
echo 'fullcmd: ' . $cmd . '<br>'; | |
//} | |
$command = str_replace("#","", $_POST['command']); | |
$exit = cmd_exec($cmd , $stdout, $stderr); | |
//print the output | |
foreach ($stdout as $line) | |
{ | |
echo "$line<br>"; | |
} | |
//in case there an error is returned | |
foreach ($stderr as $line) | |
{ | |
echo "$line<br>"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment