![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| check ssh connection to remote host | praveenbvarrier | Shell Programming and Scripting | 6 | 10-06-2008 12:46 PM |
| How can my unix shell script automatically connect to remote host? | digdarshan | Shell Programming and Scripting | 8 | 06-29-2007 11:44 PM |
| How to delete the files from local host to remote host | krishna176 | SUN Solaris | 3 | 03-24-2007 04:48 PM |
| Remote SSH Connection Using Script | ajith_tg | Shell Programming and Scripting | 1 | 07-21-2005 10:42 AM |
| FTP - Connection Closed By Remote Host | mouglybean | IP Networking | 1 | 10-26-2004 09:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Define "up and running".
Code:
ping -c 1 remotehost || { echo "does not respond to ping" >&2 ; exit ; }
rup remotehost || { echo "no rup" >&2; exit; }
# if you have netcat, and ssh on port 22 on remotehost
nc -z remotehost 22 || { echo "nobody home on port 22" >&2; exit; }
ssh remotehost true || { echo "does not let me in" >&2; exit; }
This obviously also depends on firewall blocks and stuff like that. |
|
||||
|
By that definition, if your scp fails, it's not.
Code:
if scp remotemachine:path/to/file here/ then # it's up and running! whee else echo "could not scp: $?" >&2 exit $? fi |
|
||||
|
If you can ssh, you can scp.
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| ping, ping port, port, port ping |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|