Hello,
i try to reboot a local mikrotik device from another mikrotik.
unfortunately i don’t have a linux box with curl or ssh to script and crontab.
so i thought 2 ways…
ssh and rest api
- rest api i use
/tool/fetch url=https://192.168.1.211:10443/rest/system/scripts/reboot check-certificate=no mode=https user=admin password="mypassword" http-method=get
status: failed
failure: closing connection: <400 Bad Request> 192.168.1.211:10443 (4)
instead with https://192.168.1.211:10443/rest/system/scripts/resource works fine.
or i create a script
:execute {/system reboot;}
but how i can run that script with fetch?
another way is ssh.
so i can create ssh keys and put public on mikrotik to restart. (in system users ssh key import public)
and import in “master” device in system users ssh private key.
but in terminal i can’t select ssh private key…
/system/ssh address=192.168.1.211 port=22 user=admin
and then?
i think most convenient use rest api, but i can’t understand how integrate with fetch instead curl…
thank you