![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Please help!
Hi All,
I need to run a part of script , until a certain process is running on some other host. My initial idea was to, do a ssh and check it with ps -ef. Please refer to the command below: Code:
p=`ssh -q root@hostname ps -ef | grep <process_name> | grep -v grep |wc -l` If p -gt 1; then < Start the code here > Please let me know, if anyone knows this, or if anyone has a better way out! Thanks! nua7 |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Can you exchange pub keys for passwordless communication?
|
|
#3
|
|||
|
|||
|
Well I would love to do that, but that is a security violation here..
Another idea that has come to my mind is create a emty temp file, the other process will create this file and just before it ends, it would delete the file. I would check for the existence of the file , if the file exists the process is running. One more idea is to check the pid of the expect script, which is running that application. Please let me know what you think. Thanks! nua7 |
|
#4
|
|||
|
|||
|
Security violation?
I don't know expect but it has to store the password somewhere too, to make the unattended login. Same as ssh/sftp/scp, which just places it encrypted in the authorized_keys. And it's only the public key so... Maybe the admin of the other box can give you a limited chroot environment including ps and some more, so you can do your job and he will add your pub key to his authorized_keys. |
|
#5
|
|||
|
|||
|
Thanks zaxxon! I will try to persuade them.
|
|
#6
|
|||
|
|||
|
Don't forget using a public key that was generated with pressing enter when you were asked for the password/passphrase. Else it will not work and always ask for the PW again.
|
|
#7
|
|||
|
|||
|
Sure! I'll keep that in mind.
|
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|