#!/bin/bash
cat >&1 <
Radio Station Emulator : index
EOF
echo '
application/json
'
echo '
Latest list route
'
echo '
Lists
'
find hashes -type f | while read filepath
do
hash_string="$(basename ${filepath})"
file ${filepath} | grep 'JSON text data' > /dev/null 2>&1
if [ $? -eq 0 ]
then
if [ "$(cat ${filepath} | jq -r '.type')" == "list" ]
then
echo '- '${hash_string}'
'
fi
fi
done
echo '
'
echo '
Shows
'
find hashes -type f | while read filepath
do
hash_string="$(basename ${filepath})"
file ${filepath} | grep 'JSON text data' > /dev/null 2>&1
if [ $? -eq 0 ]
then
if [ "$(cat ${filepath} | jq -r '.type')" == "show" ]
then
echo '- '${hash_string}'
'
fi
continue
fi
done
echo '
'
echo '
audio/ogg
'
find hashes -type f | while read filepath
do
hash_string="$(basename ${filepath})"
file ${filepath} | grep 'Ogg data, Vorbis audio' > /dev/null 2>&1
if [ $? -eq 0 ]
then
echo '- '${hash_string}'
'
continue
fi
done
echo '
'
cat >&1 <
EOF