#!/bin/sh #------------------------------------------------------------------------------ # Copyright (C) 2006 by EUMETSAT #------------------------------------------------------------------------------ # # Project: EUMETCast # # Component: Reception Station # # Module: monitor-eku-decoding # # Author: Anthony Patchett # # Creation Date: 26/06/2006 # #------------------------------------------------------------------------------ # # 001 Patchett 26/06/2006 Initial version # #------------------------------------------------------------------------------ # # Monitors the EKU decoding # # If the penultimate line of the tellicast client log file contains the string # "Failed to decode key", there is an EKU decoding problem. In this case the # the tellicast client, pcscd and etokend services are stopped and restarted. # # Note that since the last line of the tellicast client log file may not be # complete, the penultimate line is monitored. # #------------------------------------------------------------------------------ # the tellicast client log file... TELLICAST_CLIENT_LOG_FILE=/var/log/recv.log readonly TELLICAST_CLIENT_LOG_FILE # the penultimate line... PENULTIMATE_LINE=`tail -2 $TELLICAST_CLIENT_LOG_FILE | head -1` # check the contents of the penultimate line... if [ "`echo $PENULTIMATE_LINE | grep "Failed to decode key"`" != "" ]; then # the penultimate line contains "Failed to decode key" - there is an EKU decoding problem... # stop the tellicast client, pcscd and etokend services... /etc/init.d/tellicast-client stop /etc/init.d/pcscd stop /etc/init.d/etokend stop # start the etokend, pcscd and tellicast client services... /etc/init.d/etokend start /etc/init.d/pcscd start /etc/init.d/tellicast-client start fi