Applescript to shut down NAS

I can shut down my QNAP NAS over LAN with Terminal like this:
(SSH enabled in NAS)

ssh [admin-user]@[LAN-IP-of-NAS]
—enter password
poweroff
exit


I need an applescript that will do this for me.

Anyone who can help??

Bjorn

Google helps sometimes. Here’s one with an interesting approach using an “expect” shell script. Create the shell script then run it from applescript using “do shell script”. And here’s another by using a Terminal window and keystrokes.