Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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