#!/bin/bash HOST="http://beddy.uberzach.com:32400" CURL_OPTS=(--silent --connect-timeout 5 --max-time 10) NUM_SERIES=15 NUM_EPISODES=6 MAX_RESULTS=100 # Select a configuration mode URL1="${HOST}/library/sections/2/onDeck/" URL2_POST="children/allLeaves?unwatched=1" if echo "${1}" | grep -iq Movie; then URL1="${HOST}/library/sections/1/recentlyAdded/" URL2_POST="" fi # Find recent items ITEMS="`curl ${CURL_OPTS[@]} "${URL1}" | \ grep '