Mailinglist Archive: opensuse (3513 mails)

< Previous Next >
[opensuse] BASH help - Better way to test if remote host running openSuSE or windows?
  • From: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
  • Date: Sun, 11 Jan 2009 12:03:06 -0600
  • Message-id: <496A345A.50205@xxxxxxxxxxxxxxxxxx>

I'm looking for a quick test to see whether a remote host is running
(openSuSE) or windows. One test I have come up with is:


if ssh ${SERVER} "cat /etc/SuSE-release" > /dev/null 2>&1; then
echo "${SERVER} running linux"
echo "${SERVER} running windows"

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"
echo -e "\n\t${SERVER} samba connection NOT available\n"

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
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
This Thread
Follow Ups