Script for LTE too smart mode. fetch / post

Greetings!
we just bought a new LTE modem that needs activation after each plugging in via special software.
so, pseudo-LTE interface is unable to work in mikrotik properly by itself.

after some googling I found a way to bipass usage of ‘special software’ - just sending POST request to modem from any device that is able to reach this modem.

so it works well on my laptop connected to mikrotik by python/Jupiter:

import requests
URL='> http://192.168.0.1/goform/goform_set_cmd_process> ’
HEADERS={‘Host’: ‘192.168.0.1’, ‘Accept’: ‘/’, ‘Referer’: '> http://192.168.0.1/goform/goform_set_cmd_process> '}
PARAMS={‘goformId’: ‘CONNECT_NETWORK’}
r = requests.post(url = URL, headers = HEADERS, data = PARAMS)
print(r.text)

but this should be automated for field-using.

I tried but did’t succeed to write different variations of fetch command, like this one:

/tool fetch mode=http url=“> http://192.168.0.1/goform/goform_set_cmd_process> " http-method=post http-header-field=Host:192.168.0.1,Accept:/,Referer:> http://192.168.0.1/goform/goform_set_cmd_process > http-data=”{‘goformId’: ‘CONNECT_NETWORK’}"

may you please help to find out what’s wrong with that? (and to create a script that runs this code after starting interface lte1 ^_^’ )

thank you in advance.

/fetch http-method=post url=“http://192.168.0.1/goform/goform_set_cmd_process” http-data=“goformId=CONNECT_NETWORK” http-header-field=“Referer:http://192.168.0.1/goform” output=none

Added this script to netwatch and it works fine.

On current FW 6.47.2 it is not possible to run the script via netwatch.
Need to use scheduler to run the script (you can set any time to run the script
and final version for me now (with logging to debug if needed):

:if ([/ping 8.8.8.8 count=2 size=64] !=2) do={
/log info "start lte startup sequence"
/fetch http-method=post url="http://192.168.0.1/goform/goform_set_cmd_process" http-data="goformId=CONNECT_NETWORK" http-header-field="Referer:http://192.168.0.1/goform" output=none
/log info "start lte complete"
}