jenkins quits when executing a shell script halfway through,
Hi, it looks like your scripts kill itself.
when you invoke Kill function - it performs Kill -9 -${Pid} - so it means that you have some error in identifying PID of the process that you want to kill