Shutdown jupyter kernel

I am sharing my notebooks with colleagues by exposing the jupyter door on our internal network. When they leave the notebook, a lot of kernels keep running.

I am looking for a way for automatically shutdown a jupyter-notebook kernel when exiting. Does anyone know if it is possible?