#!/bin/bash # ************************************************************ # AltEPG Project Source Code Version Control # $FileID: git::root/etc/rc.d/rc.sysinit.author $ # $Revision: altepg1.0c root 2011-09-17 23:39:32 +0100 Finalising altepg1.0c $ # Description: hack startup script # # This script searches the TiVo disk for all hacks and # install each one it finds. # ************************************************************ # # DON'T EDIT THIS FILE! To control what is run by this script, create # a file called /etc/sysinit.conf, copy the relevant "enable" lines from # /etc/dflt_sysinit.conf into /etc/sysinit.conf, and change them to be # "YES" or "NO" as required. # Load default parameters and any overrides and network parameters . /etc/dflt_sysinit.conf . /etc/sysinit.conf . /etc/oztivo.conf export LD_LIBRARY_PATH=/var/hack/lib checkstartup() { eval _value=\$${1} #debug "checkyesno: $1 is set to $_value." case $_value in # "yes", "true", "on", or "1" [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0 ;; # "no", "false", "off", or "0" [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1 ;; "") return 0 # if variable not present, start by default ;; *) echo "Warning: ${1} is not set properly - see /etc/dflt_sysinit.conf" return 1 ;; esac } echo "Starting hacks" cd /var/hack for hackname in * do if [ -d "$hackname" ]; then if [ -f "$hackname/startup" ]; then if [ -f "$hackname/version" ]; then version=$(cat "$hackname/version") else version="(unknown)" fi hackversion="$hackname version $version" if checkstartup "${hackname}_enable"; then echo "Starting hack \"$hackversion\"" ./$hackname/startup else echo "Startup of hack \"$hackversion\" is disabled" fi fi fi done echo "Done starting hacks"