Last active
June 1, 2020 06:58
-
-
Save NoNamePro0/a5c70e8efbaa83f882720a84a541e3dc to your computer and use it in GitHub Desktop.
Run a command in the background witch automatically rerun
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
name='yourName' | |
command="yourCommand" # Use ${0%/*} to go in the folder from the start.sh | |
timeout='120' | |
script_path="${0}" | |
if [[ $1 == "--non-background" ]] | |
then | |
$command | |
sleep $timeout | |
$script_path | |
exit | |
else | |
screen -AmdS $name $script_path --non-background | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment