#!/bin/sh #---------------------------------------------------------------------------------- # /var/install/bin/ssmtp-pre-view-log - extract log information # # Copyright (c) 2008-2010 Stefan Goldbach, stefan(at)altergraben(dot)de # Copyright (c) 2011-2023 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2012-01-01 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_file=/var/log/messages log_tmp_file=/tmp/messages.ssmtp if [ -s ${log_file} ] then # at least one log file exists # -h suppress leading file name grep -h " sSMTP\[" ${log_file} > ${log_tmp_file} if [ $? -ne 0 ] then echo "Info: Nothing has been logged until now." > ${log_tmp_file} fi else echo "Warning: Logfile ${log_file} not found or empty!" > ${log_tmp_file} fi