qstream-tv 691 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#!/bin/bash

y=`date +%Y`
m=`date +%m`
d=`date +%d`
h=`date +%H`


tv=/var/lib/qstream/data/tv
ydir=$tv/$y
test -d $ydir || mkdir $ydir
mdir=$ydir/$m
test -d $mdir || mkdir $mdir
ddir=$mdir/$d
test -d $ddir || mkdir $ddir
#hdir=$ddir/$h
#test -d $hdir || mkdir $hdir

# tmp=$tv/data/tmp/$$
# test -d $tmp || mkdir $tmp

cd $ddir

export IFS=";"
# export MALLOC_CHECK_=1   # write comprehensive error message when fail
ulimit -c 500000000

while read kanal mcaddr rest; do

  echo $kanal | egrep -q '^\s*#'
  if test $? = 1 ; then # no comment
     log=`echo $kanal | sed -e 's/ /_/g'`
     /usr/bin/qstream -format full -nohead -v -last 10 -net $mcaddr >> $log.log  2>>$log.error

  fi
done