Created
August 19, 2020 18:49
-
-
Save sarjsheff/db015be538ad4289e2da1aebc651f1e9 to your computer and use it in GitHub Desktop.
Script for always restart service. +ash +openwrt
This file contains hidden or 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/sh | |
| if [ -z ${1} ] | |
| then | |
| echo "Set shell script." | |
| else | |
| trap 'kill $(jobs -p);logger exit;exit' SIGINT SIGTERM EXIT | |
| for i in `seq 1 50000` | |
| do | |
| logger -t ${0} "Start [${@}] try number $i." | |
| exec ${@} & | |
| wait | |
| logger -t ${0} "Exit" | |
| done | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment