Hibernate a WD EX2 Ultra via SSH

Hi !

I boot a WD EX2 Ultra using WOL.

But how to properly hibernate a WD EX2 Ultra via SSH ?

There a multiple ways suggested in the forum:

Which script exactly is executed if i click on “Hibernate” on UI ?
update: looked into code and via ui i think “cgi_shutdown” is called … but found no source for it as is an elf file.

br, uberl

2 Likes

Hi!
The above question is still puzzling me, because Wake-On LAN (WOL) only works, if the hibernation is executed via the web GUI.
If I use any ssh command (inside a bat file via plink (from putty)) to hibernate the system (usr/sbin/shutdown.sh (with and without parameters), halt, shutdown, etc.*)), WOL doesn’t work anymore.
*) I believe a script (like shutdown.sh) should be used instead of poweroff, halt commands as this unmounts the drives etc.
MyCloud Version is 5.08.115 and I cannot find cgi_shutdown on my system…
PS: as recommended in About SSH "poweroff" command
SSH command: /usr/local/modules/script/shutdown.sh -h now doesn’t work…

1 Like

I just used this command below as you mentioned:

/usr/local/modules/script/shutdown.sh -h now

and it worked fine shutting down the EX2 Ultra
Firmware 5.18.117

Thank you for your reply.
I might try it some time, but I am using the REST API, which does the job as well:

curl -sSL -c cookie.dat --header “Content-Type:application/json” --request POST --data “{"username":"XXXXX","password":"XXX_inBASE64_XXX"}” http://192.XXX.XXX.XXX/nas/v1/auth
curl -b cookie.dat http://192.168.0.111/cgi-bin/system_mgr.cgi?cmd=cgi_shutdown

another good feature:
change power config (windows 10):
powercfg -setactive ID(of config, like d1190081-9dd2-46d2-aec7-c35b45e66abc)