fsix

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

1 Neutral

About fsix

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Oh, that does make sense actually, then just to clarify: if I set it to the "array off" schedule, it'll finish the script first before actually turning off the array?
  2. Thanks! Wonder if there is a better method then to schedule for actual poweroff only then? since I do sometimes stop the array and it could take some time to sync the backup. Your example would immediately exit and schedule it for "now" - so it would make sense only for power on I assume? otherwise it'll just poweroff and abort the script from executing, right?
  3. If I schedule something to be executed on "At Stopping Of Array" - will that make the power down wait for that user script to finish first? I wanted to have an automatic backup sync before powerdown, but since there is no scheduling for "At Power Off" or similar, I was wondering if it would work by just having it run at stop of array, though then it begs the question too; until my script finishes I can't start the array again either?
  4. @Squid Sadly didn't work, but the var.ini was the solution still! Start: #!/bin/bash CSRF=$(cat /var/local/emhttp/var.ini | grep -oP 'csrf_token="\K[^"]+') curl -k --data "startState=STOPPED&file=&csrf_token=${CSRF}&cmdStart=Start" http://localhost/update.htm Stop: #!/bin/bash CSRF=$(cat /var/local/emhttp/var.ini | grep -oP 'csrf_token="\K[^"]+') curl -k --data "startState=STARTED&file=&csrf_token=${CSRF}&cmdStop=Stop" http://localhost/update.htm
  5. @Squid Thanks! I guess it checks both for get and post values? because all forms I could find were doing a post exclusively. Based on what you said that should work, will try it in an hour or two to confirm: #!/bin/bash CSRF=$(cat /var/local/emhttp/var.ini | grep -oP 'csrf_token="\K[^"]+') wget -qO /dev/null http://localhost:$(lsof -nPc emhttp | grep -Po 'TCP[^\d]*\K\d+')/update.htm?cmdStart=Start&csrf_token=$CSRF
  6. I couldn't find how to move the other topic as I think it is more appropriate to be posted here after all, since it isn't really related to "general support" and more of the programming side of unraid:
  7. Since the dashboard now requires a csrf-token, the old wget-method does not work anymore: Is there any way to locally execute the array start/stop functions directly or is there a command for it? I have searched through tons of includes, php, template files and couldn't find where they actually execute it - besides all POSTing to the same endpoint. Of course a solution could be to have a headless browser or requests that regex out the csrf token prior, but it'd be much easier to just have something e.g. executed via ssh if available. Thank you in advanced!