summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-06-25 20:09:18 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-06-25 20:09:18 -0700
commit519afc33c5446fdd9abba34563ef839c924fb52e (patch)
tree0d416066d260ca5f346cc1dfaff057425b53891b
parenta18be7b8a613125646ba8c7cdfa0309e96ff9412 (diff)
downloadtxrban-519afc33c5446fdd9abba34563ef839c924fb52e.tar.gz
txrban-519afc33c5446fdd9abba34563ef839c924fb52e.tar.bz2
txrban-519afc33c5446fdd9abba34563ef839c924fb52e.zip
Use if/elif/else syntax.
* apache.txr: Convert @(cases) with @(require) pattern to the equivalent if/elif/else syntactic sugar.
-rw-r--r--apache.txr12
1 files changed, 5 insertions, 7 deletions
diff --git a/apache.txr b/apache.txr
index 6793a78..96a4f9a 100644
--- a/apache.txr
+++ b/apache.txr
@@ -4,16 +4,14 @@
@ (all)
@ip - - [@(n day)/@(m month)/@(n year):@(n hour):@(n min):@(n sec) @nil] "@method @uri @proto/@ver" @err @bytes "@ref" "@agent"
@ (and)
-@ (cases)
-@ (require (search-regex agent #/Googlebot|bingbot|baidu/))
+@ (if (search-regex agent #/Googlebot|bingbot|baidu/))
@ (bind points nil)
-@ (or)
-@ (require (search-regex agent #/Ezoom|[Bb][Oo][Tt]|[Ss]pider|[Cc]rawler|[Yy]andex|coccoc/))
+@ (elif (search-regex agent
+ #/Ezoom|[Bb][Oo][Tt]|[Ss]pider|[Cc]rawler|[Yy]andex|coccoc/))
@ (bind points 9)
-@ (or)
-@ (require (not (memqual err '("200" "301" "304"))))
+@ (elif (not (memqual err '("200" "301" "304"))))
@ (bind points 1)
-@ (or)
+@ (else)
@ (bind points 0)
@ (end)
@ (end)