#!/bin/bash #... just to make vim happy # # - private.bashlib- # Pseudo module MailPre # # Return the process ID of smtpd stored in the global variable $REPLY # which represents the log line get_PF_smtpd_PID() { local funtag="[${FUNCNAME[0]}]" local result : echo $funtag # awk ' # BEGIN { # match($0, /\/smtpd\[([0-9]+)\]/, arr) # pid=arr[1] # print pid # } # ' <<< "$REPLY" # result=`echo "$REPLY" | grep -oP '(?<=\/smtpd\[)[0-9]+(?=\])'` if [ -n "$result" ] then (( transaction[sequence]++ )) transaction[type]=smtpd transaction[logline]=$REPLY transaction[smtpdPID]=$result return 1 fi } get_DBMAIL_PID() { local funtag="[${FUNCNAME[0]}]" : echo $funtag }