iopupgrade: Kill the watchdog only if it has been started.

This commit is contained in:
Ronny Nilsson 2019-12-04 15:07:55 +01:00
parent 42c0e1ecc8
commit b376a0b16a

View file

@ -67,7 +67,10 @@ function finish {
fi
# always kill the timeout process, will leave the sleep but that is harmless
# as long as the kill will nerver be run.
kill $TIMEOUT_PID 2>/dev/null
if [ -n "$TIMEOUT_PID" ]; then
kill $TIMEOUT_PID 2>/dev/null
TIMEOUT_PID=""
fi
lock -u /tmp/iopu.lock
}