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
1. rest api i use
Code: Select all
/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)
or i create a script
Code: Select all
:execute {/system reboot;}
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...
Code: Select all
/system/ssh address=192.168.1.211 port=22 user=admin
i think most convenient use rest api, but i can't understand how integrate with fetch instead curl...
thank you