Skip to content

Instantly share code, notes, and snippets.

@n13i
Created December 10, 2017 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n13i/e0dd46edf54e8a58a3cb01fdf6234975 to your computer and use it in GitHub Desktop.
Save n13i/e0dd46edf54e8a58a3cb01fdf6234975 to your computer and use it in GitHub Desktop.
#!/bin/sh
/usr/local/bin/recfsusb2n $@
PID=`pgrep --parent 1 --oldest recfsusb2n`
if [ -z "${PID}" ]; then
exit 1
fi
echo "recfsusb2n running: PID=${PID}"
trap 'kill -9 ${PID}; exit 0' 1 2 3 15
while [ -d "/proc/${PID}" ]; do
sleep 5
done
echo "PID=${PID} not found. exit."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment