#!/bin/bash
echo "Iniciando..."
#echo "Limpiando"
#rm "/home/fos-streaming/fos/www/hl/"*
#rm "./launch.log"

#FILES=/var/www/html/izzinew/ffmrun/*
FILES=/var/www/html/star/bin/*
for f in $FILES
do
canal=`basename ${f}`
proceso=`pgrep -x ${canal}`
if [[ $canal =~ "-stlive" ]]; then proceso=1; fi
if [ ${#canal} -le 7 ]; then canal=$canal"\t" ; fi
if [ -z $proceso ]; then
  $f > /dev/null 2>&1 &
  echo -e " "$canal"\t Iniciando!"
  sleep 3
 else
  echo -e "$(tput setaf 3)"$canal"$(tput setaf 7)\t\t ya esta $(tput setaf 2)UP$(tput setaf 7). Proceso: \t$(tput setaf 4)"$proceso"$(tput setaf 7)"
fi
done
exit

