Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'erb'
- # Setup variables
- monit_path = "/usr/bin/monit"
- tor_path = "/usr/bin/tor"
- delegated_path = "/usr/local/bin/delegated"
- haproxy_path = "/usr/local/bin/haproxy"
- install_path = "/Users/mauroasprea/rotating-tors"
- user = "username"
- email = "email@example.com" # where moint and delegated will send mails.
- tors_count = 4
- haproxy_port = 3128
- delegated_base_port = 3129
- tor_base_port = 9050
- tor_control_base_port = 8118
- # Optional: setup gmail smtp for monit outgoing alerts
- gmail_username = "email@gmail.com"
- gmail_password = "password"
- # Prepare paths
- `mkdir -p #{install_path}/etc`
- `mkdir -p #{install_path}/caches`
- `mkdir -p #{install_path}/pids`
- # haproxy.cfg
- c = ERB.new(File.read("haproxy.cfg.erb"))
- File.write("#{install_path}/etc/haproxy.cfg", c.result(binding))
- `chmod 600 #{install_path}/etc/haproxy.cfg`
- # monitrc
- c = ERB.new(File.read('monitrc.erb'))
- File.write("#{install_path}/etc/monitrc", c.result(binding))
- `chmod 600 #{install_path}/etc/monitrc`
Add Comment
Please, Sign In to add comment