Skip to content

Instantly share code, notes, and snippets.

@pegli
Created July 18, 2012 16:46
Show Gist options
  • Save pegli/3137381 to your computer and use it in GitHub Desktop.
Save pegli/3137381 to your computer and use it in GitHub Desktop.
list function for `mx
{
"_id": "_design/configs",
"_rev": "4-a0b96a31984e1267e6ecf46302744451",
"views": {
"subnet": {
"map": "function(doc) {\n emit(null, doc);\n};"
}
},
"lists": {
"conf_fmt": "function(head, req) {\n var row;\n start({\n \"headers\": {\n \"Content-Type\": \"text/plain\"\n }\n });\n\n while(row = getRow()) {\n send(\"subnet \" + row.value.network + \" netmask \" + row.value.netmask + \"{ option routers \" + row.value.gateway + \"; }\\n\" );\n }\n}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment