#!/bin/sh

#$1 stream name
#$2 stream uri
#$3 record time
#===============================================================================

year=$(date +%Y)
month=$(date +%m)
day=$(date +%d)

if [ ! -d "$1" ]; then
  mkdir $1
fi
cd $1
if [ ! -d "$year" ]; then
  mkdir $year
fi
cd $year
if [ ! -d "$month" ]; then
  mkdir $month
fi
cd $month
if [ ! -d "$day" ]; then
  mkdir $day
fi
cd $day

$HOME/GStreamer_audioRecorder/streamRecorder $2 $3

