View previous topic :: View next topic |
Author |
Message |
Maximus2000 Tux's lil' helper


Joined: 07 Oct 2004 Posts: 127 Location: USA
|
Posted: Wed Feb 15, 2006 2:56 pm Post subject: Writing and ssh script help |
|
|
Hi,
I would like to write a script that would check to see if sshd is running. If it is not then have it start sshd and if it is do nothing. I would place this script into a cronstab and have it run every 30minutes. I need this to make sure that the remote machine I am supporting has ssh turned on at all times. I am not much of a script writer and that is why I am asking for some help. _________________ Thanks
Maximus |
|
Back to top |
|
 |
tagwar Tux's lil' helper


Joined: 11 Aug 2004 Posts: 147 Location: Karlsruhe
|
Posted: Wed Feb 15, 2006 3:23 pm Post subject: solved.. |
|
|
Code: |
#!/bin/bash
pidof sshd
if [ $? -ne 0 ]; then
/etc/init.d/sshd restart
fi
|
ugly but works.... |
|
Back to top |
|
 |
Maximus2000 Tux's lil' helper


Joined: 07 Oct 2004 Posts: 127 Location: USA
|
Posted: Wed Feb 15, 2006 6:04 pm Post subject: |
|
|
Thank you very much don't realy care if it is ugly or not. _________________ Thanks
Maximus |
|
Back to top |
|
 |
|