Skip to content

Instantly share code, notes, and snippets.

@natebrunette
Created May 11, 2019 01:44
Show Gist options
  • Save natebrunette/e69441315613b23dd1d5af085de68b4a to your computer and use it in GitHub Desktop.
Save natebrunette/e69441315613b23dd1d5af085de68b4a to your computer and use it in GitHub Desktop.
Simple script to restart a command
#!/bin/bash
echo "Executing: $@"
until $("$@")
do
echo "Process crashed with exit code $?. Respawning..." >&2
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment