#! /bin/sh
# $Id: FCT,v 1.1.5.1 2000/07/16 12:00:01 root Exp root $
# $Date: 2000/07/16 12:00:01 $
#
# File: FCT
# Desc: Startupfile SYS V R4 for FCT
#
# Author: J. Friedrich
# 
#   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, or (at your option)
#   any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
# (c) Copyright 1998 Jens Friedrich
# $Log: FCT,v $
# Revision 1.1.5.1  2000/07/16 12:00:01  root
# FCT
#
# Revision 1.1.4.2  2000/07/15 19:01:24  jens
# Rev.
#
# Revision 1.1.4.1  1999/08/01 21:44:54  jens
# .
#
# Revision 1.1  1999/08/01 21:44:54  jens
# Initial revision
#
# Revision 1.0.9.1  1998/06/02 18:11:07  jens
# initial ci -r1.0.9
#
# Revision 1.0  1998/06/02 18:10:40  jens
# Initial revision
#
#

# location of FCT
FCT_DIR=/var/adm/FCT

START_FCT="yes"
# read configfile, which can overwrite above setting!
[ -f /etc/rc.config ] && . /etc/rc.config
# option force starts FCT anyway
[ `echo "$*" | grep -c force` -gt 0 ] && START_FCT=yes

test "$START_FCT" = yes || exit 0

# maybe you want to use this
#logfilter=/var/adm/FCT/etc/syslog.filter
#deny_cmds=/var/adm/FCT/etc/deny_cmds

case "$1" in

    start)
	#echo "Starting FCT-firewall."
	#[ `ps -ex | grep syslog.filter | grep -v grep | cut -b-5` ] || \
	#     [ -f $logfilter ] && $logfilter &
	#[ `ps -ex | grep deny_cmds | grep -v grep | cut -b-5` ] || \
	#     [ -f $deny_cmds ] && $deny_cmds &
	$FCT_DIR/firewall start
	;;

    stop)
	#echo -n "Shutting down FCT-firewall:"
	$FCT_DIR/firewall stop
	#kill `ps -ex | grep syslog.filter | grep -v grep | cut -b-5`
	#kill `ps -ex | grep deny_cmds | grep -v grep | cut -b-5`
	;;

    *)
	echo "Usage: $0 [force] {start|stop}"
	exit 1
esac
