Remove lock file if inhibiting tasks

This commit is contained in:
D. Berge
2023-04-11 20:50:59 +02:00
parent 8118641231
commit c3b3a4c70f

View File

@@ -90,6 +90,12 @@ function run () {
rm $STDOUTLOG $STDERRLOG
}
function cleanup () {
if [[ -f $LOCKFILE ]]; then
rm "$LOCKFILE"
fi
}
if [[ -f $LOCKFILE ]]; then
PID=$(cat "$LOCKFILE")
if pgrep -F "$LOCKFILE"; then
@@ -110,6 +116,7 @@ print_info "Start run"
print_log "Check if data is accessible"
$BINDIR/check_mounts_present.py || {
print_warning "Import mounts not accessible. Inhibiting all tasks!"
cleanup
exit 253
}