Skip to content

Instantly share code, notes, and snippets.

@adborden
Last active March 12, 2020 15:11
Show Gist options
  • Save adborden/45b999e37f872aaeeab98724099ca6cf to your computer and use it in GitHub Desktop.
Save adborden/45b999e37f872aaeeab98724099ca6cf to your computer and use it in GitHub Desktop.
Script to continually retry a command over SSH until it succeeds.
#!/bin/bash
set -o nounset
host=$1
shift
while ! ssh "$host" "$@"; do sleep 30; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment