Skip to content

Instantly share code, notes, and snippets.

@davidmz
Created November 28, 2012 14:33
Show Gist options
  • Save davidmz/4161662 to your computer and use it in GitHub Desktop.
Save davidmz/4161662 to your computer and use it in GitHub Desktop.
Скрипт авторестарта программы
#!/bin/sh
if [ $# -eq '0' ]
then
echo 'Empty command'
exit 1
fi
stop=0
trap 'stop=1' TERM QUIT INT
while [ $stop -eq '0' ]
do
$@
sleep 1
done
echo 'Bye'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment