mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 13:22:36 +00:00 
			
		
		
		
	for moving the update function to new web gui git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6800 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
		
			
				
	
	
		
			30 lines
		
	
	
		
			691 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			691 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
/* Required libraries */
 | 
						|
$TOPDIR = '..';
 | 
						|
require_once "$TOPDIR/lib/functions.php";
 | 
						|
require_once "$TOPDIR/lib/jsonwrapper.php";
 | 
						|
 | 
						|
/**
 | 
						|
 * Issue a xCAT command, e.g. rpm -qa xCAT
 | 
						|
 * This will handle system commands.  If not, you can create your
 | 
						|
 * own .php.  Look at zCmd.php for an example.
 | 
						|
 *
 | 
						|
 * @param 	$cmd	The system command
 | 
						|
 * @return 	The system response.  Replies are in the form of JSON
 | 
						|
 */
 | 
						|
 | 
						|
if (isset($_GET["cmd"])) {
 | 
						|
    // HTTP GET requests
 | 
						|
    $cmd = $_GET["cmd"];
 | 
						|
    $ret = "";
 | 
						|
 | 
						|
    if ("ostype" == $cmd) {
 | 
						|
        $ret = strtolower(PHP_OS);
 | 
						|
    }
 | 
						|
    else {
 | 
						|
        $ret = shell_exec($cmd);
 | 
						|
    }
 | 
						|
 | 
						|
    echo json_encode(array("rsp"=>$ret));
 | 
						|
}
 | 
						|
?>
 |