From 93f1b67ba178d1f091fb7db8d34569bc8cb3410b Mon Sep 17 00:00:00 2001 From: hummypkg Date: Thu, 29 Sep 2011 22:58:13 +0000 Subject: [PATCH] add epg parser git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@432 2a923420-c742-0410-a762-8d5b09965624 --- etc/init.d/S60parseepg | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 etc/init.d/S60parseepg diff --git a/etc/init.d/S60parseepg b/etc/init.d/S60parseepg new file mode 100755 index 0000000..75e5b09 --- /dev/null +++ b/etc/init.d/S60parseepg @@ -0,0 +1,43 @@ +#!/bin/sh + +export PATH=/mod/bin:/mod/usr/bin:/mod/bin/busybox:/bin:/sbin +export LD_LIBRARY_PATH=/mod/lib:/lib:/usr/lib +export TZ=GMT+0BST,M3.5.0/1,M10.5.0/2 + +if [ -f /mnt/hd1/dvbepg/epg.dat ]; then + epg=/mnt/hd1/dvbepg/epg.dat + epgdb=/mnt/hd1/epg.db +else + epg=/media/drive1/epgsavedata + epgdb=/media/drive1/epg.db +fi + +case "$1" in + start) + ( + while [ 1 ]; do + if [ -f $epgdb ]; then + touch $epgdb.stamp + now=`stat -c %Z $epgdb.stamp` + dbstamp=`stat -c %Z $epgdb` + age=`expr $now - $dbstamp` + else + age=99999 + fi + echo "EPG Database age: $age" + if [ $age -gt 28800 ]; then + sleep 120 + echo "Generating EPG database..." + /mod/bin/epg -f $epg sqlitedump $epgdb + fi + sleep 3712 + done + ) & + ;; + stop) + ;; + *) + exit 1 + ;; +esac +