badrep.blogg.se

Readynas remote for mac
Readynas remote for mac









You don't have permission to access /dbbrokerĪs you can see, it has the token, but it still reports “Forbidden”. * upload completely sent off: 376 out of 376 bytes

readynas remote for mac

> Content-Type: application/x-www-form-urlencoded > X-CSRFToken: SqzNmy9s78lY3LydAw217jaeKxLW04zhFem0mVmEHI6jR5pwL08fDGZWQlZpO_X_0IeKtmZQ0pvv-xYiBRVE0X4B4kh9Mz3j3D3hWorJSmY= > Authorization: Basic YWRtaW46JU44QlZqV3c1ZVVf * Server auth using Basic with user 'admin' * Expire in 200 ms for 4 (transfer 0x13ca880) * Expire in 0 ms for 6 (transfer 0x13ca880) Token=$(curl -sS -u $username:$password | grep -oP '"csrfpId", "\K+')Ĭurl -sS -v -header "X-CSRFToken: $token" -u $username:$password -k " -H "Content-Type: application/x-www-form-urlencoded " -H "X-Requested-With: XMLHttpRequest" -data "" I have a feeling something has changed on the ReadyNas side, as I have tried a few variations including the below: #!/bin/sh Your script to get the token works perfectly. The parsing part could be handled many different ways. Hopefully that gives an idea how to do it. Then you would just call this bash script from home assistant to shut down. For example, if your shutdown command was the following (found from some random github page)Ĭurl -u admin -k -d command=poweroff -d shutdown_option=1 -d OPERATION=set -d PAGE=System -d OUTER_TAB=tab_shutdown -d INNER_TAB=none -F"message>" ''

readynas remote for mac readynas remote for mac

Now use that token in the other curl command you already use, whatever it may be, by adding the -header option. token=$(curl -sS -u username:password | grep -oP '"csrfpId", "\K+') The following command could parse the token. Assuming the output looks like their example: Again, without a device, this is just guess. We will now have to do 2 separate curl commands. Don’t have a ReadNAS or anything to test it on, but reading that thread, the curl command will work with an extra parameter.











Readynas remote for mac