[opensuse] BASH help - Better way to test if remote host running openSuSE or windows?
Listmates; I'm looking for a quick test to see whether a remote host is running Linux (openSuSE) or windows. One test I have come up with is: SERVER="//${1:-nirvana}" if ssh ${SERVER} "cat /etc/SuSE-release" > /dev/null 2>&1; then echo "${SERVER} running linux" else echo "${SERVER} running windows" fi Then for testing whether samba is available, I have: if smbclient -U% -L${SERVER} >/dev/null 2>&1; then echo -e "\n\t${SERVER} up and samba connection available\n" else echo -e "\n\t${SERVER} samba connection NOT available\n" fi I know there must be a cleaner or quicker way. Does anyone else have a favorite way to testing the OS on a remote host they wouldn't mind sharing? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday, 2009-01-11 at 12:03 -0600, David C. Rankin wrote:
I know there must be a cleaner or quicker way. Does anyone else have a favorite way to testing the OS on a remote host they wouldn't mind sharing?
Your test assumes you can log in. If you can't, you could try "nmap", but it is not fast. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAklqXwYACgkQtTMYHG2NR9XGqwCfcIqa7JWqlrEjNL5wT+BRHKAH opgAn1zwpkci4KprhWZJ/22oxha/Boer =YpS+ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (2)
-
Carlos E. R.
-
David C. Rankin