#! /bin/sh #---------------------------------------------------------------------------------- # /var/install/bin/twadmin-post-view-alarms-log - view log file # # Copyright (c) 2003-2007 Maximilian Pasternak # Copyright (c) 2008-2018 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2012-03-16 jed # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------------- log_dir=/var/log log_file=${log_dir}/log.twadmin.alarms log_lines=`wc -l ${log_file} | cut -d' ' -f1` if [ ! -s "${log_file}" ] then # empty file rm -f ${log_file} elif [ "${log_lines}" = "1" ] then if `grep -q "^Info: Nothing has been logged until now." ${log_file}` then rm -f ${log_file} fi fi