Many projects come with a script that checks that the service is set up correctly. Use it, but read it first. You did not write it, and it can be wrong too.
1. Read itcat bin/check.sh
2. Run itit needs x: sudo chmod +x
3. Read the resultOK or FAIL on each line, then echo $?
4. Fix, and run againfix the project, or the script if the script is wrong
Read it
sh
cd /srv/stock-api
ls -l bin
cat bin/check.shThe script uses some commands that this course did not teach, such as readlink, awk and cut -c. You do not need them. Read the comments, the variables at the top and the echo lines: they say what each part checks.
Read the result
| Output | Means |
|---|---|
OK ... | That check passed |
FAIL ... | That check failed. The text says what |
grep: ...: No such file or directory | The script read a path that does not exist |
echo $? writes 0 | Every check passed |
When the script itself cannot find a file, compare the path in the script with the real directories:
sh
grep -n CONF bin/check.sh
lsFix the variable with nano, save, and run the script again. Do this until the last line is RESULT: ALL OK.