From fd62dadd02773e8f026bebe7154a9e73b6161dbc Mon Sep 17 00:00:00 2001 From: immarvin Date: Tue, 7 Jul 2015 22:56:31 -0400 Subject: [PATCH] fix defect 4727 [fvt]runcmdinstaller could not work on sles12; fix defect 4726 [fvt]2.10:ubruncmdinstaller could not work on untuntu; fix defect 4724 [fvt]2.10:runcmdinstaller should add -h options and man page --- xCAT-server/sbin/runcmdinstaller | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/xCAT-server/sbin/runcmdinstaller b/xCAT-server/sbin/runcmdinstaller index d4bf19509..3b51020de 100755 --- a/xCAT-server/sbin/runcmdinstaller +++ b/xCAT-server/sbin/runcmdinstaller @@ -1,16 +1,13 @@ -#!/bin/awk -f +#!/bin/sh #usage: #runcmdinstaller: issue command which run in the installer and print the command output #runcmdinstaller "" -BEGIN { -node = ARGV[1] -#port = ARGV[2] -port = 3001 -#action = ARGV[3] -action = "sh" -cmd = ARGV[2] -if(ARGC !=3 || ! node || ! cmd){ + +awk -v argc="$#" -v node="$1" -v cmd="$2" 'BEGIN { +port = 3001 +action = "sh" +if( node=="-h" || argc !=2 || ! node || ! cmd){ print "Usage:\n\n runcmdinstaller \"\"\n" print " make sure all the commands are quoted by \"\"\n"; exit 1; @@ -27,4 +24,4 @@ print $0 close(ns) exit 0 -} +}'