#!/bin/bash python3 app.py & PID_APP=$! python3 cameraworker.py & PID_CAM=$! python3 tickworker.py & PID_TICK=$! function terminate() { kill $PID_APP $PID_CAM $PID_TICK } trap terminate INT wait $PID_APP $PID_CAM $PID_TICK