Skip to content

Instantly share code, notes, and snippets.

@ehlertij
Created June 8, 2012 18:37
Show Gist options
  • Save ehlertij/2897495 to your computer and use it in GitHub Desktop.
Save ehlertij/2897495 to your computer and use it in GitHub Desktop.
proxy_down
# proxy_down.sh
#!/bin/bash
echo 'Reloading haproxy...'
/data/ngin/shared/bin/haproxy_remove
ssh -o StrictHostKeyChecking=no -i /home/deploy/.ssh/internal deploy@APP_MASTER "sudo sed -i -r 's/(HOSTNAME:8080)/HOSTNAME:81/g' /etc/haproxy.cfg"
/data/ngin/shared/bin/haproxy_add
echo 'Sleeping for 5s before stopping emproxy...'
sleep 5
echo 'Stopping emproxy...'
sudo monit stop all -g emproxy_ngin
echo 'Done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment