#! /bin/sh
#
# pipe1.sh
#
# Example script to startup vfind as a daemon process using named pipes.
#
# See also: file1.sh
#
# Version: Tue May  7 21:09:50 EDT 2002
#
# Please check the CAUTION and CONFIGURATION sections below,
# and modify this script to suit your requirements before trying to use it.
# CyberSoft, Inc. is not responsible for any damage, be it physical or mental,
# caused or indirectly caused by this example script.
#
# Copyright (c) May 2002 by CyberSoft, Incorporated.

###
##
# CAUTION:
#
# This script uses the current directory, removes any existing files
# named "in1" and "out1", and creates named pipes with those names.
# The default umask is used.  The `tail' and `vfind' processes will
# continue to run in the background until killed.
#
##
###

###
##
# CONFIGURATION:
#
# paths for shell commands and vfind
#
PATH="/usr/bin:/usr/sbin"
VSTK_HOME="/opt/vstk"
export PATH VSTK_HOME
#
vfind="$VSTK_HOME/bin/vfind"
#
##
###

# remove any existing pipes
#
rm -f in1 out1

# create in/out pipes
#
mknod in1 p
mknod out1 p

# use tail on the pipe, and run vfind with the -p option:
#
# -p, --per-file   Per-file: count of number of possible virus infections
#                  displayed for each file.
#
echo "$0: running vfind using pipes in1 and out1" 1>&2
tail +0cf in1 | $vfind -p >out1 2>&1 &
