#!/bin/sh
#
# File: syslogng-mssql-pipe.sh
#
# Take input from a FIFO and run execute it as a query for
# a sqlserver database.
#
# IMPORTANT NOTE:  This could potentially be a huge security hole.
# You should change permissions on the FIFO accordingly.
#
#isql MSTEST "sa" "maccs@123"
#use syslogng
#go

if [ -e /tmp/mssql.syslog-ng.pipe ]; then
       while [ -e /tmp/mssql.syslog-ng.pipe ]
                do
                       isql -v MSTEST "sa" "password" < /tmp/mssql.syslog-ng.pipe  
 
        	done  
else
        mkfifo /tmp/mssql.syslog-ng.pipe
fi

