This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: how to test sshd running ?
- From: "Larry Hall (Cygwin)" <reply-to-list-only-lh at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 18 Dec 2006 10:54:51 -0500
- Subject: Re: how to test sshd running ?
- References: <loom.20061218T134744-95@post.gmane.org>
- Reply-to: cygwin at cygwin dot com
kato fong wrote:
Hi,
I want to write a sh script that executes itself if sshd is not running.
But what is the reliable way to test if I get sshd running under
cygwin/windows95?
This isn't a Cygwin-specific question. As such, discussion of it is
really off-topic for this list.
That said, the following should work (untested on Cygwin or W95):
#! /bin/bash
ps -C sshd >& /dev/null
if [ $? -eq 0 ]
then
echo sshd running
else
echo sshd not running
fi
It's wordy but you get the idea. ;-)
--
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
216 Dalton Rd. (508) 893-9889 - FAX
Holliston, MA 01746
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/