Closed jaydouble closed 2 years ago
Hi,
don't worry. :D Thank you for your contribution!
Regarding the bugfix: I haven't tested your changes yet, but doesn't echo
print the text and in this case the return value? I have also seen multiple examples, where echo
as a sort of return
statement, but to be honest, I was a bit afraid testing it because I don't know if it prints the return value into the shell or not. :D
The function wil echo it out, but the $() will grab the output, an put that into the variable. example
currentTimestamp=$(date +%s)
if you type date +%s
in your terminal, you will see someting like 1641850387
.
So bash (or any other linux shell) will grab the output of the command, and put it into the variable, so the variable currentTimestamp
will now contain 1641850387
I guess it's "the way" to go in Bash. I was sort of thinking Java-ish. :D
in the current version, the check_docker_command is always returning false. So docker restart containers and or services is never going to work.
I've make little fix, and also introduce a new function to check any command exists.
This is also my very first pull request every on github (as far as I remember). So please, don't be angry if I don't do something right.