From 8159dfd0fd83d58c903dc820992cd2fe9bd598ed Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Mon, 7 May 2012 18:45:56 +0000 Subject: [PATCH] Add support for running rcons via sudo on aix git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12554 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/rcons | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xCAT-client/bin/rcons b/xCAT-client/bin/rcons index e16813268..f75aa90aa 100755 --- a/xCAT-client/bin/rcons +++ b/xCAT-client/bin/rcons @@ -1,9 +1,17 @@ #!/bin/sh + +# Provide serial console access to nodes + +# To handle cases like running this via sudo, get the home dir properly os=`uname` if [ "$os" == "Linux" ]; then HOME=`getent passwd $(whoami)|cut -d: -f 6` export HOME fi +if [ "$os" == "AIX" ]; then + HOME=`lsuser -a home $(whoami)|cut -d= -f 2` + export HOME +fi if [ -z "$1" ] || [ "$1" = "-h" ]; then echo "rcons - remotely accesses the serial console of a node"