Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The Code
- #!/usr/bin/expect -f
- # Filename: beanstalk-purge
- set timeout 1
- spawn telnet [lindex $argv 0] [lindex $argv 1]
- sleep 1
- send "use [lindex $argv 2]\n"
- expect "USING"
- for {set i 1} {$i < [lindex $argv 3]} { incr i 1 } {
- send_user "Proccessing $i\n"
- expect -re {.*} {}
- send "peek-ready\n"
- expect -re {FOUND (\d*) \d*}
- send "delete $expect_out(1,string)\n"
- expect "DELETED"
- }
- Usage
- beanstalk-purge <host> <port> <tube> <count>
- Example
- beanstalk-purge 127.0.0.1 11300 snitch.site 35000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement