Skip to content

Commit

Permalink
Fix return codes
Browse files Browse the repository at this point in the history
  • Loading branch information
antlafarge committed Jul 16, 2024
1 parent 27e5a91 commit 5d7c722
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ setup "$JD_EMAIL" "$JD_PASSWORD" "$JD_DEVICENAME"
setupExitCode=$?
if [ $setupExitCode -ne 0 ]; then
groupEnd
fatal $setupExitCode "setup.sh exited with code \"$setupExitCode\""
fatal $setupExitCode "setup exited with code \"$setupExitCode\""
fi
groupEnd

Expand Down
14 changes: 7 additions & 7 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ groupEnd()
# Reset indent
groupReset()
{
((logIndent=0))
logIndent=0
}

# Fatal error occured : log and exit
Expand All @@ -37,7 +37,7 @@ fatal()

log "FATAL ERROR :" "$fatal_log"
log "Get more informations here : https://github.com/antlafarge/jdownloader#troubleshooting"
groupEnd
groupReset
log "CONTAINER TERMINATED"
exit ${fatal_exitCode:-1}
}
Expand All @@ -56,7 +56,7 @@ waitProcess()
sleepExitCode=$?

if [ $sleepExitCode -ne 0 ]; then
fatal "sleep exited with code \"$sleepExitCode\""
fatal $sleepExitCode "sleep exited with code \"$sleepExitCode\""
fi
done
fi
Expand All @@ -80,7 +80,7 @@ handleSignal()
stop=true
killProcess $pid
else
groupEnd
groupReset
log "CONTAINER KILLED"
exit $((128 + $handleSignal_signalCode))
fi
Expand All @@ -105,7 +105,7 @@ replaceJsonValue()

if [ $sedExitCode -ne 0 ]; then
log "ERROR" "sed exited with code \"$sedExitCode\""
exit $sedExitCode
return $sedExitCode
fi
}

Expand Down Expand Up @@ -135,7 +135,7 @@ setup()

if [ $printfExitCode -ne 0 ]; then
log "ERROR" "printf exited with code '$printfExitCode'"
exit $printfExitCode
return $printfExitCode
fi
fi

Expand All @@ -150,7 +150,7 @@ setup()

if [ $printfExitCode -ne 0 ]; then
log "ERROR" "printf exited with code '$printfExitCode'"
exit $printfExitCode
return $printfExitCode
fi
fi

Expand Down

0 comments on commit 5d7c722

Please sign in to comment.