diff --git a/xCAT-client-2.0/bin/getnodecfg b/xCAT-client-2.0/bin/getnodecfg index eb3f4d67d..aa58e7d2d 100755 --- a/xCAT-client-2.0/bin/getnodecfg +++ b/xCAT-client-2.0/bin/getnodecfg @@ -2,7 +2,7 @@ # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html BEGIN { - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; use xCAT::Table; diff --git a/xCAT-client-2.0/bin/pping b/xCAT-client-2.0/bin/pping index 493c59b7d..cd08ea034 100755 --- a/xCAT-client-2.0/bin/pping +++ b/xCAT-client-2.0/bin/pping @@ -6,7 +6,7 @@ #method Net::Ping provides. BEGIN { - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; diff --git a/xCAT-client-2.0/bin/psh b/xCAT-client-2.0/bin/psh index 16c2fdcb1..ed9cf518b 100755 --- a/xCAT-client-2.0/bin/psh +++ b/xCAT-client-2.0/bin/psh @@ -2,7 +2,7 @@ # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html BEGIN { - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; use IO::Socket::SSL; diff --git a/xCAT-client-2.0/bin/xcatDBcmds b/xCAT-client-2.0/bin/xcatDBcmds index e0cadcad6..c8ae9b71b 100755 --- a/xCAT-client-2.0/bin/xcatDBcmds +++ b/xCAT-client-2.0/bin/xcatDBcmds @@ -2,7 +2,7 @@ # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html BEGIN { - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; diff --git a/xCAT-client-2.0/bin/xcatclient b/xCAT-client-2.0/bin/xcatclient index aef4f4522..e7867dc54 100755 --- a/xCAT-client-2.0/bin/xcatclient +++ b/xCAT-client-2.0/bin/xcatclient @@ -2,7 +2,7 @@ # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html BEGIN { - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; use Cwd; diff --git a/xCAT-client-2.0/bin/xdsh b/xCAT-client-2.0/bin/xdsh index d79eeedbc..52eb09eb2 100644 --- a/xCAT-client-2.0/bin/xdsh +++ b/xCAT-client-2.0/bin/xdsh @@ -2,7 +2,7 @@ # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html BEGIN { - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; use IO::Socket::SSL; diff --git a/xCAT-client-2.0/bin/xdshbak b/xCAT-client-2.0/bin/xdshbak index f4f9d1b51..b7d1aa09e 100644 --- a/xCAT-client-2.0/bin/xdshbak +++ b/xCAT-client-2.0/bin/xdshbak @@ -3,7 +3,7 @@ ##################################################################### BEGIN { - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; use xCAT::MsgUtils; diff --git a/xCAT-client-2.0/sbin/tabrestore b/xCAT-client-2.0/sbin/tabrestore index 7381ee63a..44d08eeff 100755 --- a/xCAT-client-2.0/sbin/tabrestore +++ b/xCAT-client-2.0/sbin/tabrestore @@ -3,7 +3,7 @@ #Just like xcatclient, but needs to read a file in and pass it as $request->data BEGIN { - $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; use IO::Socket::SSL;