mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 03:12:30 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			709 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			709 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/sh 
 | |
| #usage:
 | |
| #runcmdinstaller: issue command which run in the installer and print the command output
 | |
| #runcmdinstaller <node> "<command>"
 | |
| 
 | |
| 
 | |
| awk  -v argc="$#" -v node="$1" -v cmd="$2" 'BEGIN {
 | |
| port = 3001
 | |
| action = "sh"
 | |
| if(node=="-h"){
 | |
|   print "Usage:\n\n   runcmdinstaller <node> \"<command>\"\n"
 | |
|   print           "   make sure all the commands are quoted by \"\"\n";
 | |
|   exit 0;
 | |
| }
 | |
| if(argc !=2 || ! node || ! cmd){
 | |
|   print "Usage:\n\n   runcmdinstaller <node> \"<command>\"\n"
 | |
|   print           "   make sure all the commands are quoted by \"\"\n";
 | |
|   exit 1;
 | |
| }
 | |
| 
 | |
| ns = "/inet/tcp/0/" node "/" port
 | |
| 
 | |
| #print "sh " |& ns
 | |
| print action " " cmd " " |& ns
 | |
| 
 | |
| while((ns |& getline) > 0)
 | |
| print $0
 | |
| 
 | |
| close(ns)
 | |
| 
 | |
| exit 0
 | |
| }'
 |