#!/bin/sh

### sample start servers file (copy to /usr/local/lib)
### start from '/etc/rc.local'
### BINDIST NeXT release 2 (packed up by Frank Siegert frank@this.net)

# 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.

LOGd=/tmp
LOGf=/dev/null
CAP=/usr/local/cap
LIB=/usr/local/lib/cap

LWARGS="-a ${LIB}/procsets -f ${LIB}/LW+Fonts"

ZONE=`cat ${LIB}/active_zone`

#
# Start up BPF before doing anything
#

echo "Starting BPF..."
/usr/local/etc/bpf_load

#
# Start UAR first if used
#
# ${CAP}/uar -C "interface"
# sleep 10

#
# Otherwise start aarpd first for Native EtherTalk
#

echo "Starting up the aaprd network deamon for ${ZONE}..."
${CAP}/aarpd en0 "${ZONE}"

#
# Or capd for Kernel AppleTalk under Linux
#
# ${CAP}/capd "interface" "zone"

#
# allow atis to startup before other CAP programs
#

echo "Starting the atis deamon..."
${CAP}/atis

#
# Make this 15 seconds if using aarpd
#

echo "Waiting now 15 sec for atis to establish..."
sleep 15

# snitch is a CAP program designed to run as a daemon to respond to InterPoll
# requests. It performs the same function as the "Responder" program on a 
# Macintosh.

${CAP}/snitch -S -f "NeXTSTEP 3.3" -l lwsrv8

# now startup the printing services

# For LaserWriter7 use the following

# ${CAP}/lwsrv -n "NeXTSpooler" -p myUnixQueue ${LWARGS}

# For LaserWriter8 (prefered) use this instead, look in /usr/local/lib/cap
# for lwsrc.conf and DBfile, the format i descibed in the CAP doc. Don't
# forget to rebuild the database for DBfile if you changed something

echo "Startup LaserWriter spooler..."
${CAP}/start-print-servers

# if CAP compiled with FIXED_DIRIDS then start AFP ID server first
# this is not the case in the Bindist NeXT release
# ${CAP}/afpidsrvr -l ${LOGd}/afpidsrvr.log

echo "Startup file services..." 
${CAP}/start-file-servers

# at this point CAP should be up and running, it is possible for aufs not
# to be visible at once but in a few seconds, so be patient

# End of Script
