This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // CustomTime provides an example of how to declare a new time Type with a custom formatter. | |
| // Note that time.Time methods are not available, if needed you can add and cast like the String method does | |
| // Otherwise, only use in the json struct at marshal/unmarshal time. | |
| type CustomTime time.Time | |
| const ctLayout = "2006-01-02 15:04:05 Z07:00" | |
| // UnmarshalJSON Parses the json string in the custom format | |
| func (ct *CustomTime) UnmarshalJSON(b []byte) (err error) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :local apiPrefix "https://uablacklist.net/subnets_mikrotik_" | |
| :local tempFile "uablacklist.txt" | |
| :local listName "uablacklist" | |
| /log info "removing existing '$listName'..." | |
| :put "removing existing '$listName'..." | |
| /ip firewall address-list remove [/ip firewall address-list find list=$listName] | |
| # mikrotik can't load >4KB file inside a variable, so backend contains file pieces which we download and parse one by one | |
| :local i 0 |
OlderNewer