#!/bin/sh ACTION=$1 STREAM=$2 DIR=$(dirname $0) cd $DIR case ${ACTION} in start) python2.7 ./ffmpeg-wrapper.py ${STREAM} & ;; stop) PID=$(cat ./stream-${STREAM}.pid) kill ${PID} ;; esac