remotely shutdown nas : fetch and cookie-based auth

I’m trying to remotely shutdown a NAS with a fetch command (rb2011 and nas are on the same ups)

So far, I’ve found (with live http headers in firefox), the cgi url that shuts down it.
But it works only from firefox url bar, if I’m already logged in.
No way to use it like http://user:pass@host , I’ve seen there inside the cookie from the NAS there’s an auth token…

Is there a way to use fetch in this situation?

Other ideas are quite unsuccessful:

  1. This idea (shutdown the nas from the mikrotik with http) seems not working
  2. Shutdown the nas from the mikrotik using ssh may work, but sshd on the nas is “unofficial”
  3. Telnet from the mikrotik to the nas could works, but it’s not scriptable
  4. Shutdown the mikrotik from the nas is wrong (mik would not restart automatically)
  5. I could just connect the ups to the nas and hope that mikrotik doesn’t suffer from “power missing”