run-in-simulavr.sh: make stopping on "stop" working again.

It was so far unnoticed that the "simulavr" program is only a
script when run from within the build directory. Still killing it
by name worked, because bash's exec didn't terminate the initiating
script.

Apparently this week Ubuntu updated bash and the new version now
terminates the initiating script (which is a good idea), but now
the executable to kill by name has a different name. It's prefixed
with "lt-". As this "lt-" is hardcoded we can rely on it.
This commit is contained in:
Markus Hitter 2015-02-21 00:58:49 +01:00
parent a6be2f9584
commit 74c9924366
1 changed files with 3 additions and 2 deletions

View File

@ -91,8 +91,9 @@ for GCODE_FILE in $*; do
echo "${LINE}"
case "${LINE}" in
stop)
echo "Got \"stop\", killing ${SIMULAVR}."
kill -INT $(pidof -x "${SIMULAVR}")
echo "Got \"stop\", killing $(basename ${SIMULAVR})."
killall -INT $(basename "${SIMULAVR}") 2> /dev/null || \
killall -INT "lt-"$(basename "${SIMULAVR}")
;;
esac
done