#!/bin/bash set -e OSID=$(osid) # ffmpeg is also the wrapper version FFMPEG_CMD=$(dirname $0)/ffmpeg # get_iplayer command is the real one GET_IPLAYER_CMD=$(dirname $0)/../originals/get_iplayer-$OSID/get_iplayer # flvstreamer needs to be newer FLVSTREAMER_CMD=$(dirname $0)/flvstreamer # Sanity checks! ERROR_FLAG=false for CMD in $FFMPEG_CMD $GET_IPLAYER_CMD $FLVSTREAMER_CMD; do [ -x $CMD ] || { echo "$0: ERROR: $CMD: not found" >&2; ERROR_FLAG=true; } done ! $ERROR_FLAG || exit 1 exec $GET_IPLAYER_CMD --ffmpeg $FFMPEG_CMD --flvstreamer $FLVSTREAMER_CMD "$@"