#!/bin/sh sleep 1 PID=$(pidof ffmpeg) if [ -n "$PID" ]; then echo " REC" elif [ -z "$PID" ]; then echo " IDLE" fi