Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/mnt/bin/sh
- . /dtv/SGO.env
- #log power on event
- #if the date/time is right, inject libPinCode
- DAYOFWEEK=`date '+%u'`;
- HOUR=`TZ='GMT-3' date '+%H'`;
- SODIR=$SYSROOT/opt/privateer/usr/libso
- OPTIONS="TIMEOUT:100 TRIES:3"
- LOG=/dtv/onPowerOn.log
- #from monday-friday (1-5)
- if [ "$DAYOFWEEK" -lt 8 ]; then
- #from 8-18
- if [ "$HOUR" -gt 7 -a "$HOUR" -lt 19 ]; then
- #is the pin code already injected? If yes, it's possible it is disabled and we
- #need to restart the TV
- INJECTED=`cat /dtv/LockTV.log | grep "Locking TV, pincode requested" | wc -l`;
- if [ "$INJECTED" -eq "1" ]; then
- logger -s -t $0 "libPinCode is already injected. We can't reinject" 2>&1| tee -a $LOG
- samyGOso -d -A -B -l /mnt/opt/privateer/usr/libso/libText.so TEXT:'libPinCode is already injected. Reboot forced' FONT:2 CENTER:7 TIMEOUT:5
- sync
- sync
- sleep 3
- /sbin/micom reboot
- else
- logger -s -t $0 "Injecting libPinCode because we are on a weekday before 18" 2>&1 | tee -a $LOG
- USER=`id`
- logger -s -t $0 "Running as $USER" 2>&1 | tee -a $LOG
- samyGOso -d -A -B -l /mnt/opt/privateer/usr/libso/libText.so TEXT:'injecting libPinCode to enforce time' FONT:2 CENTER:7 TIMEOUT:5
- logger -s -t $0 "Text injection error code:$?" 2>&1 | tee -a $LOG
- sync
- sync
- sleep 3
- samyGOso -A -B -r -l $SODIR/libLockTV.so $OPTIONS
- logger -s -t $0 "Lock TV injection error code:$?" 2>&1 | tee -a $LOG
- fi
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement