#!/bin/sh
#
# /etc/rc.d/init.d/ax25 -- this should be linked into the appropriate rc.d
# to start AX25 services at startup

echo "This startup script was written by G1ZPU and probably won't work properly!"
echo "Starting AX25 networking services"
#
#Fire up the SCC interfaces
#

modprobe scc
/sbin/sccinit
#
# Now to setup up the interfaces
#
# Set the IRQ for the third serial port to IRQ10
#
/bin/setserial /dev/ttyS2 irq 10
#
# Link to GB7PT via a YAM on COM2 (ttyS1)
#
/bin/setserial /dev/ttyS3 port 0
/usr/sbin/yamcfg yam1 iobase 0x2e8 irq 15
/sbin/ifconfig yam1 44.131.162.130 hw ax25 gb7zpu-11
/sbin/ifconfig yam1 netmask 0xfffffff0
/sbin/ifconfig yam1 arp mtu 256 up
echo "YAM Setup"
/sbin/ifconfig yam1
#
# 6m port on SCC port B
#
/sbin/ifconfig scc1 44.131.162.130 hw ax25 gb7zpu-6
/sbin/ifconfig scc1 netmask 0xfffffff0
/sbin/ifconfig scc1 arp mtu 256 up
echo "scc1 setup"
#
# 4m port on KISS TNC via COM2 (ttyS1)
#
/usr/sbin/kissattach /dev/ttyS1 4m 44.131.162.130
/sbin/ifconfig ax0 44.131.162.130 hw ax25 gb7zpu-4
/sbin/ifconfig ax0 netmask 0xfffffff0
/sbin/ifconfig ax0 arp mtu 256 up
echo "ax0 - 4m setup"
#
# 2m port on PC100 Port B
#
/sbin/ifconfig scc5 44.131.162.130 hw ax25 gb7zpu-2
/sbin/ifconfig scc5 netmask 0xfffffff0
/sbin/ifconfig scc5 arp mtu 256 up
echo "scc5 setup"
#
# 432.675MHz port on KISS TNC via COM3 (ttyS2)
#
/usr/sbin/kissattach /dev/ttyS2 432 44.131.162.130
/sbin/ifconfig ax1 44.131.162.130 hw ax25 gb7zpu-7
/sbin/ifconfig ax1 netmask 0xfffffff0
/sbin/ifconfig ax1 arp mtu 256 up
echo "ax1 - 432.675 setup"
#
# 433.650MHz port on USCC Port A
#
/sbin/ifconfig scc0 44.131.162.130 hw ax25 gb7zpu-9
/sbin/ifconfig scc0 netmask 0xfffffff0
/sbin/ifconfig scc0 arp mtu 256 up
echo "scc0 - 433 setup"
#
# 439.825MHz 9K6 on USCC Port D
#
/sbin/ifconfig scc3 44.131.162.130 hw ax25 gb7zpu-1
/sbin/ifconfig scc3 netmask 0xfffffff0
/sbin/ifconfig scc3 arp mtu 256 up
echo "scc3 - 439 setup"
#
# Link port 9K6 on USCC port C
#
/sbin/ifconfig scc2 44.131.162.130 hw ax25 gb7zpu-12
/sbin/ifconfig scc2 netmask 0xfffffff0
/sbin/ifconfig scc2 arp mtu 256 up
echo "scc2 - 9K6 link setup"
# 
# Link port 9K6 on PC100 port A
#
/sbin/ifconfig scc4 44.131.162.130 hw ax25 gb7zpu-3
/sbin/ifconfig scc4 netmask 0xfffffff0 
/sbin/ifconfig scc4 arp mtu 256 up
echo "scc4 - 9K6 link setup"
#
# Set up the slip link
if [ -f /etc/rc.d/rc.link ]; then
    /etc/rc.d/rc.link
fi
#
# Set up NETROM
#
/usr/sbin/nrattach -i 44.131.162.130 netrom
/usr/sbin/nrattach -i 44.131.162.130 netbbs
echo "netrom ports setup"
#
/usr/sbin/kissattach /dev/ptyqe axip 44.131.162.130
sleep1
# Setup the internal netrom >< IP link
#
# Start up the daemons
#
/usr/sbin/ax25d
/usr/sbin/ax25ipd
/usr/sbin/netromd
/usr/sbin/mheardd
/usr/local/fbb/xfbb.sh -d &
#
# That's all folks


