Page 1 of 1

(solved) upload rule remote via json or any other remote script

Posted: 09 Mar 2019, 08:38
by riker1
Hi

I am wondering if it would be possible to use the flash process remote
via json
or other methodes?

Thanks T

Re: upload rule remote via json or any other remote script

Posted: 09 Mar 2019, 09:16
by grovkillen
You can use curl and upload a rule text file.

Re: upload rule remote via json or any other remote script

Posted: 09 Mar 2019, 09:19
by riker1
Sounds great
Naming of Textfile Just rules1.txt?
Thanks

Re: upload rule remote via json or any other remote script

Posted: 09 Mar 2019, 09:28
by grovkillen
Yep, and make sure you have the latest and greatest version.

Re: upload rule remote via json or any other remote script

Posted: 09 Mar 2019, 15:09
by riker1
Hi I am struggling with the curl command

do you have an example please?

I assume it is a curl -u upload

Thanks thomas

Re: upload rule remote via json or any other remote script

Posted: 27 Mar 2019, 12:56
by riker1
Hi

could yo upost a template uploading rules?

It is not working for me.

Thanks T

Re: upload rule remote via json or any other remote script

Posted: 28 Mar 2019, 18:01
by ThomasB

Code: Select all

could you post a template uploading rules? It is not working for me.
Uploading rules files using curl appears to be partially broken. The main issue is that it will only work if the file to be uploaded is already named in the file system.

Try this:
1. Go to the rules tab and choose the rule set you wish to update. If it does not exist then this action will create a blank rule file in SPIFFS with the rulesX.txt naming convention. If there is already a rule file present then that is fine too.

2. Close the rules tab (exit the rules page). This is mandatory! Failure to do this will cause rules1.txt to be copied to the currently selected rules page when you use curl. {this bug caused me a lot of grief}

3. Use curl to submit the new ruleX.txt file, using this format:

Code: Select all

curl -v -F upload=@FULL_PATH_TO_RULES\rules2.txt http://IP_ADDRESS/upload
note: Change FULL_PATH_TO_RULES\rules2.txt and IP_ADDRESS with your information.

- Thomas

Re: upload rule remote via json or any other remote script

Posted: 28 Mar 2019, 18:14
by riker1
Hi Thomas

thanks working perfect!!

Re: (solved) upload rule remote via json or any other remote script

Posted: 28 Mar 2019, 18:40
by ThomasB
Great! Thanks for confirming the workaround helped you out.

- Thomas

Re: (solved) upload rule remote via json or any other remote script

Posted: 29 Mar 2019, 00:56
by schnurzel59
ThomasB do not Sleeping. ThomasB must be an Robot.

Re: (solved) upload rule remote via json or any other remote script

Posted: 29 Mar 2019, 02:17
by ThomasB
ThomasB must be an Robot.
Shhhush! That's suppose to be a secrete. :)

- Thomas