Last active
August 29, 2015 14:17
-
-
Save raphink/56874c75d6e964a2c2c3 to your computer and use it in GitHub Desktop.
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
module Agocontrol = autoload xfm | |
let comment = IniFile.comment "#" "#" | |
let sep = IniFile.sep "=" "=" | |
let entry = IniFile.indented_entry IniFile.entry_re sep comment | |
let title = IniFile.indented_title IniFile.record_re | |
let record = IniFile.record title entry | |
let lns = IniFile.lns record comment | |
let filter = (incl "/etc/opt/agocontrol/conf.d/*.conf") . (incl "/usr/local/etc/agocontrol/conf.d/*.conf") | |
let xfm = transform lns filter |
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
module Test_Agocontrol = | |
let alert_conf = "[mail] | |
smtp=smtp.free.de | |
[email protected] | |
login= | |
password= | |
tls=0 | |
[twitter] | |
key=625343032-XXXXXXXXXXXXXXXXXXXXXXXXXXX | |
secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
[push] | |
provider=pushbullet | |
[pushbullet] | |
apikey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
devices=[\"Mozilla Firefox (ujyPVc3SoKadjz99WkCibI)\"] | |
[sms] | |
provider=freemobile | |
[freemobile] | |
user=XXXXXXXX | |
apikey=XXXXXXXXXXXXXX\n" | |
test Agocontrol.lns get alert_conf = | |
{ "mail" | |
{ "smtp" = "smtp.free.de" } | |
{ "sender" = "[email protected]" } | |
{ "login" } | |
{ "password" } | |
{ "tls" = "0" } | |
} | |
{ "twitter" | |
{ "key" = "625343032-XXXXXXXXXXXXXXXXXXXXXXXXXXX" } | |
{ "secret" = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" } | |
} | |
{ "push" | |
{ "provider" = "pushbullet" } | |
} | |
{ "pushbullet" | |
{ "apikey" = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" } | |
{ "devices" = "[\"Mozilla Firefox (ujyPVc3SoKadjz99WkCibI)\"]" } | |
} | |
{ "sms" | |
{ "provider" = "freemobile" } | |
} | |
{ "freemobile" | |
{ "user" = "XXXXXXXX" } | |
{ "apikey" = "XXXXXXXXXXXXXX" } | |
} | |
let quotes = "[mqtt] | |
topic = 'sensors/#' | |
topic2 = \"sensors2/#\"\n" | |
test Agocontrol.lns get quotes = | |
{ "mqtt" | |
{ "topic" = "sensors/#" } | |
{ "topic2" = "sensors2/#" } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment