playerpath=/smg/smgplayer
rootpath=/smg
echo "Date Time = $(date)"
echo "HwClock = $(sudo hwclock -r)"
echo "Up time = $(uptime -p)"
echo "Teamviewer ID = $(teamviewer info|grep "TeamViewer ID"|awk '{print $5}')"
echo "Disk Size = $(df -h $rootpath | grep /)"
echo "$(cat $playerpath/config.ini |grep "deviceID="|awk '{print $1}')"

t1=$(sqlite3 $playerpath/signage.db "select startTime,endTime from TimeExceptions where date('now')>=startDate and date('now')<=endDate;")
t2=$(sqlite3 $playerpath/signage.db "select strftime('%H:%M:%S',starttime),strftime('%H:%M:%S',endtime) from GlobalTimeExceptions where daynumber= strftime('%w',date('now'));")
toplam=$(echo $t1|wc -w)

if [ $toplam -gt 0 ]
then 
 echo 'Time Exception = '$t1
else
 echo 'Global Exception = '$t2
fi

echo "Song Count in Files = $(ls -1 $playerpath/files/ |grep mp3 | wc -l)"
echo "Anounce Count in Files = $(ls -1 $playerpath/files/announces/ |grep mp3 | wc -l)"
echo "Downloaded Song Files in DB = $(sqlite3 $playerpath/signage.db "select count(*) from (select distinct Filename from schedules_details where isDownloaded=1)")"
echo "Not Downloaded Song Files in DB = $(sqlite3  $playerpath/signage.db "select count(*) from (select distinct Filename from schedules_details where isDownloaded=0)")"
echo "Downloaded Announce Files in DB = $(sqlite3  $playerpath/signage.db "select count(*) from (select distinct Filename from announces_details where isDownloaded=1)")"
echo "Not Downloaded Announce Files in DB = $(sqlite3  $playerpath/signage.db "select count(*) from (select distinct Filename from announces_details where isDownloaded=0)")" 
echo "Last Song = $(sqlite3 $playerpath/logsDB.db "select OriginalName,FileName,PlayDate from logs where musicType=0 order by Playdate desc limit 1")"
echo "Last Announce = $(sqlite3 $playerpath/logsDB.db "select OriginalName,FileName,PlayDate from logs where musicType=1 order by Playdate desc limit 1")"




