rabbit-restart-loop.sh 218 B

12345678910111213
  1. #!/usr/bin/env bash
  2. secs=${1:-30}
  3. secs=$((secs - 1))
  4. while true; do
  5. sudo rabbitmqctl start_app
  6. echo "sleep for ${secs}s"
  7. sleep $secs
  8. sudo rabbitmqctl stop_app
  9. echo "sleep for 1s"
  10. sleep 1
  11. done