Last active
March 15, 2019 22:21
-
-
Save rtfmoz2/81ae6821f8d3d70f4888a409694c53dc to your computer and use it in GitHub Desktop.
BIG-IP Coffee iRule
This file contains 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
when HTTP_REQUEST { | |
set coffee { 5)3;; 4(3;; 2+1-5+1;; 2|1 5|1]1;; 2\1-5/1;;_9_2;;\1_9/1} | |
set response "Coffee 3.0\n\n" | |
switch [HTTP::uri] { | |
"/coffee" { | |
foreach {mychar myrepeat} [ split $coffee {} ] { | |
if {$mychar equals ";"} { | |
append response "[format "%-15s" $cuppa]$cuppa\n" | |
unset cuppa | |
} else { | |
append cuppa [string repeat $mychar $myrepeat] | |
} | |
} | |
append response "\n\nYour coffee's are ready.\n\n" | |
append response "The Virtual Coffee Machine" | |
HTTP::respond 200 content $response Content-Type "text/plain" Connection Close | |
event disable all | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment