Adapt admin_node_command to accept commands both via stdin and args
Change-Id: I04800a9c5e24d31942864dd5554043142584f6eb
This commit is contained in:
parent
9597ca0680
commit
652276b02a
|
@ -84,8 +84,10 @@ function with_retries {
|
|||
}
|
||||
|
||||
function admin_node_command {
|
||||
if [[ "$ADMIN_IP" == "local" ]];then
|
||||
eval "$@"
|
||||
# Accepts commands from args passed to function or multiple commands via stdin,
|
||||
# one per line.
|
||||
if [[ "$ADMIN_IP" == "local" ]]; then
|
||||
bash < <(test $# -gt 0 && echo -ne "$@" || cat)
|
||||
else
|
||||
ssh $SSH_OPTIONS $ADMIN_USER@$ADMIN_IP "$@"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue