- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Catch return code into remote command execution
Operating System - HP-UX
1752535
Members
4821
Online
108788
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2009 01:43 AM
тАО01-16-2009 01:43 AM
I guys,
I have the following reliable way to validate into a script if a system is trusted or not:
SYS_TRUSTED=`/usr/lbin/getprdef -r 2>1 > /dev/null;echo $?`
If return code is 0 the system is trusted.
So, I'm trying to catch this return code against a remote machine using the similar syntax:
REMOTE_SYS_TRUSTED=`remsh hostname -l root -n "/usr/lbin/getprdef -r;echo $?"`
The problem here is that always catch zero status, I guess that remsh return code is catched instead of "getprdef" return code.
Some hint about?
Please omit recomendation about "/tcb" folder validation or "*" in password field of /etc/passwd file.
Rgds.
I have the following reliable way to validate into a script if a system is trusted or not:
SYS_TRUSTED=`/usr/lbin/getprdef -r 2>1 > /dev/null;echo $?`
If return code is 0 the system is trusted.
So, I'm trying to catch this return code against a remote machine using the similar syntax:
REMOTE_SYS_TRUSTED=`remsh hostname -l root -n "/usr/lbin/getprdef -r;echo $?"`
The problem here is that always catch zero status, I guess that remsh return code is catched instead of "getprdef" return code.
Some hint about?
Please omit recomendation about "/tcb" folder validation or "*" in password field of /etc/passwd file.
Rgds.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2009 01:56 AM
тАО01-16-2009 01:56 AM
Solution
See this old thread how to capture exit code on rsh - http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=944722
regards,
ivan
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2009 05:27 AM
тАО01-16-2009 05:27 AM
Re: Catch return code into remote command execution
Thanks Ivan, the old thread have a lot useful info, analyzing that information could see that the trick is in using simple quotation marks instead of double quotation marks, being in the following way:
#REMOTE_SYS_TRUSTED=`remsh remotehost -l root -n '/usr/lbin/getprdef -r 2>1 > /dev/null;echo $?'`
Then $REMOTE_SYS_TRUSTED have the correct return code of the command "getprdef".
Thanks!
#REMOTE_SYS_TRUSTED=`remsh remotehost -l root -n '/usr/lbin/getprdef -r 2>1 > /dev/null;echo $?'`
Then $REMOTE_SYS_TRUSTED have the correct return code of the command "getprdef".
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2009 05:29 AM
тАО01-16-2009 05:29 AM
Re: Catch return code into remote command execution
Above explained, best regards.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP