Not sure about automatic grading, but you can try this combo:
Jupiter as basic infrastructure
with the bash_kernel to add support for bash exercises
and nbgrader for the grades.
I never used nor tested this particular combination, but you can dig a little bit the documentation to check if it works for you.