#!/bin/sh #---------------------------------------------------------------------------------- # /var/install/bin/owswitch-pre-view-log - view log file # # Copyright (c) 2016-2019 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2016-06-26 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. #---------------------------------------------------------------------------------- module_name='owswitch' log_dir=/var/log log_file=${log_dir}/${module_name}.log ### view log file ### grep -E " ${module_name}:| ${module_name}\[[0-9]+\]:" ${log_dir}/messages | grep -v "Binary file .* matches" > ${log_file} if [ -z "${log_file}" -o ! -s "${log_file}" ] then rm -f ${log_file} fi exit 0