Linux Labs

Bash: text processing and scripts / Stage 7 of 9

Exit status and a healthcheck

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 8 · on a machine · 3 min

Fix the check

The app is under maintenance again, and healthcheck.sh still prints OK. Fix it yourself. Before running it, bash -n healthcheck.sh checks the syntax: if it is silent, there are no errors.

Exercise · do it

Make the check tell the truth

The app is under maintenance now. Fix ~/health-lab/healthcheck.sh: OK and status 0 only when the app answers without an error, and FAIL with status 1 in every other case.

Sign in and start The machine is available after signing in

Goals · 0 of 3

  • Report FAIL and status 1 while the app is under maintenance not done yet
  • Report FAIL and status 1 when the app is stopped not done yet
  • Report OK and status 0 when the app is working not done yet

Step goals

0 of 3
  • Report FAIL and status 1 while the app is under maintenance — not done yet
  • Report FAIL and status 1 when the app is stopped — not done yet
  • Report OK and status 0 when the app is working — not done yet
Ubuntu 24.04

Step goals

0 of 3
  • Report FAIL and status 1 while the app is under maintenance — not done yet
  • Report FAIL and status 1 when the app is stopped — not done yet
  • Report OK and status 0 when the app is working — not done yet
Loading…