Applescript to send ssh command to a remote unit to gather status help


I have searched around the web, but nothing I have seen has answered my question…

I would like some help understanding how to use AppleScript to gather data from a remote machine…

for example:

on a normal circumstance I would do this in terminal:

ssh admin@unitip
if I am not already in the .knownhosts it will ask me to add it with “yes” (will an “expect” command help here?)
will ask for password (which I type)
then I can send the needed command…
for ease of use, let’s just say I want to send df -h and use the response as the data returned for the AppleScript.

How can you manage to obtain this data back into the Applescript?


Look at this post I think this might help you.

I did see it… a couple times, somehow, my eyes and brain must have been disconnected from lack of sleep and caffeine overdose I totally dismissed it as not what I wanted!! … but after a couple hours of sleep… It all makes sense!!!