#
#   TNET startup script
#

MYIP=148.81.31.84
MYNAME=p15-4
MYDOMAIN=ia.pw.edu.pl
MYNET=148.81.31.64
MYNETMASK=255.255.255.192
MYGATEWAY=148.81.31.65

echo Host IP is ${MYIP}
echo Host name is ${MYNAME}.$MYDOMAIN
echo Local net is ${MYNET}, netmask ${MYNETMASK}
echo Default gateway is ${MYGATEWAY}

echo Starting TNET...

# remove old stuff
rm -f /usr/spool/uucp/LCK*
rm -f /etc/tnet/.pipes/.* /etc/tnet/.pipes/*

# start the ball rolling
/etc/tnet/tnet $1 ${MYIP} < /dev/null > /dev/null 2> /etc/tnet/tnet.log &

# give tnet a chance to run and create the tnet pipe.
# really only needed first time tnet is run.
sleep 2

# initialize this host
/etc/tnet/bin/hostname ${MYNAME}.${MYDOMAIN}

# initialize ip & tcp
/etc/tnet/bin/ip ttl 32
/etc/tnet/bin/tcp window 2048
/etc/tnet/bin/tcp mss 512

# drivers
/etc/tnet/bin/attach ether et0 ether 1514 1

# routing
/etc/tnet/bin/route add default et0 ${MYGATEWAY}
/etc/tnet/bin/route add net ${MYNET} ${MYNETMASK} et0

# backgroud jobs
#/etc/tnet/bin/alive 148.81.31.1 8 &
