Skip to content

Instantly share code, notes, and snippets.

@sarjsheff
Created August 19, 2020 18:49
Show Gist options
  • Select an option

  • Save sarjsheff/db015be538ad4289e2da1aebc651f1e9 to your computer and use it in GitHub Desktop.

Select an option

Save sarjsheff/db015be538ad4289e2da1aebc651f1e9 to your computer and use it in GitHub Desktop.
Script for always restart service. +ash +openwrt
#!/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