{"id":26030202,"url":"https://github.com/karolba/lua-mikrotik","last_synced_at":"2025-09-04T04:41:06.802Z","repository":{"id":87910214,"uuid":"148923636","full_name":"karolba/lua-mikrotik","owner":"karolba","description":"A Lua library for talking to the Mikrotik RouterOS API","archived":false,"fork":false,"pushed_at":"2019-05-02T13:37:20.000Z","size":13,"stargazers_count":3,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T19:24:26.420Z","etag":null,"topics":["lua","mikrotik","routeros"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karolba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-15T17:21:36.000Z","updated_at":"2024-11-12T13:52:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"9be94a68-cb26-4496-92b9-624305545425","html_url":"https://github.com/karolba/lua-mikrotik","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/karolba/lua-mikrotik","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolba%2Flua-mikrotik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolba%2Flua-mikrotik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolba%2Flua-mikrotik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolba%2Flua-mikrotik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karolba","download_url":"https://codeload.github.com/karolba/lua-mikrotik/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolba%2Flua-mikrotik/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273553539,"owners_count":25126141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","mikrotik","routeros"],"created_at":"2025-03-06T18:27:57.347Z","updated_at":"2025-09-04T04:41:06.794Z","avatar_url":"https://github.com/karolba.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lua-mikrotik\n\nA lightweight lua library for talking to the [Mikrotik RouterOS API](https://wiki.mikrotik.com/wiki/Manual:API).\n\n## Requirements: \n\n* Either:\n\t* [luasocket](https://github.com/diegonehab/luasocket)\n\t* Either the [kikito's md5 library](https://github.com/kikito/md5.lua) or the [keplerproject's md5 library](https://github.com/keplerproject/md5)\n\t* On older Lua versions with no `bit32` (`\u003c= 5.1`), either [BitOp](http://luaforge.net/projects/bit/), or [BitLib](https://github.com/LuaDist/bitlib)\n* or [OpenResty](https://openresty.org/en/), which contains all these dependencies.\n\n## Documentation:\n\nFor documentation see [doc/api.md](https://github.com/karolba/lua-mikrotik/blob/master/doc/api.md).\n\n## Examples:\n\nStarting a RouterOS script from `/system/script` by name synchronously:\n\n```lua\nlocal Mikrotik = require 'Mikrotik'\n\nlocal function runScript(mt, scriptname)\n    assert(mt:sendSentence({ '/system/script/print', '?name=' .. scriptname, '=.proplist=.id' }))\n\n    local message = assert(mt:readSentence())\n    assert(message.type == '!re')\n    assert(mt:readSentence().type == '!done')\n\n    assert(mt:sendSentence({ '/system/script/run', '=number=' .. message['=.id']}))\n    assert(mt:readSentence().type == '!done')\n\n    print('OK!')\nend\n\nlocal mt = assert(Mikrotik:create('192.168.88.1'))\nassert(mt:login('login', 'password'), 'Failed login')\n\nrunScript(mt, 'example-routeros-script-name')\n```\n\nThe same result can be accomplished by using \"tagged sentences\" and callbacks:\n\n```lua\nlocal Mikrotik = require 'Mikrotik'\n\nlocal function runScript(mt, scriptname)\n    assert(mt:sendSentence({ '/system/script/print', '?name=' .. scriptname, '=.proplist=.id' }, function(res)\n        if res.type == '!re' then\n            assert(mt:sendSentence({ '/system/script/run', '=number=' .. res['=.id'] }, function(res)\n                if res.type == '!done' then\n                    print('OK!')\n                end\n            end))\n        end\n    end))\nend\n\nlocal mt = assert(Mikrotik:create('192.168.88.1'))\nassert(mt:login('login', 'password'), 'Failed login')\n\nrunScript(mt, 'example-routeros-script-name')\n\nassert(mt:wait())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarolba%2Flua-mikrotik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarolba%2Flua-mikrotik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarolba%2Flua-mikrotik/lists"}