#!/bin/sh
#
# This is the shell script 'bpf_load' to load the loadable kernel server
# of the Berkeley Packet Filter for NEXTSTEP.
#   Copyright (C) 1994 Satoshi Adachi.
#
# This file 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.
# 
# 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.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
#
# $Id: bpf_load,v 0.2 1994/08/10 17:33:30 adachi Exp adachi $
#

server_list=`/usr/etc/kl_util -s | awk '{print $2}'`
found="no"
for i in ${server_list}; do
	if [ "${i}" = "bpf" ]; then
		found="yes"
	fi
done
if [ "${found}" = "yes" ]; then
	echo "Server bpf has already been loaded. Please use 'bpf_unload' first."
	exit 1
else
	/usr/etc/kl_util -a /usr/local/lib/kern_loader/bpf/bpf_reloc
fi
exit 0
