#!/bin/sh # this script file is /etc/rc.d/rc.ax25 # adapted from K4GBB ax25 scripts echo 1 > /proc/sys/net/ipv4/ip_forward # just in case ... /usr/bin/killall -KILL /usr/local/sbin/kissattach /usr/bin/killall -KILL /usr/local/sbin/ax25ipd /usr/bin/killall -KILL /usr/local/sbin/mkiss /sbin/ifconfig /dev/ax0 down /sbin/ifconfig /dev/ax1 down /sbin/ifconfig /dev/ax2 down # echo "Installing ax25ipd Unix98 master pseudo tty" /bin/date > /var/log/ax25ipd.log /usr/local/sbin/ax25ipd > /tmp/unix98 echo $! > /var/run/ax25ipd.pid export AXUDP=`tail -1 /tmp/unix98` # echo "Installing a KISS link on ethernet port" /usr/local/sbin/kissattach $AXUDP axudp > /tmp/ax25-config.tmp awk '/device/ { print $7 }' /tmp/ax25-config.tmp > /tmp/ax25-config-tmp read Device < /tmp/ax25-config-tmp # Check for Device if [ -d /proc/sys/net/ax25/$Device ] then echo "Port axudp attached to $Device" cd /proc/sys/net/ax25/$Device/ # $Device parameters ifconfig $Device netmask 255.255.255.255 ifconfig $Device broadcast 0.0.0.0 else echo "** Error setting $Device parms **" fi /bin/sleep 4 echo "Installing two KISS connexions on serial port ttyS0" # aprs & uhf-1 are ports names in /etc/ax25/axports #/usr/local/sbin/mkiss -s 38400 -c -x 2 /dev/ttyS0 > /tmp/unix98 # -c enables a one-byte checksum on each incoming and outgoing KISS frame on # the serial port. This checksum is used by G8BPQ KISS roms to maintain the # integrity of KISS frames. Don't use if standard KISS EPROM. /usr/local/sbin/mkiss -s 38400 -x 2 /dev/ttyS0 > /tmp/unix98 export PTS0=`more /tmp/unix98 | grep -w /dev | cut -b -11` export PTS1=`more /tmp/unix98 | grep -w /dev | cut -b 12-` # Attach KPC9612 TNC in kiss mode - on primary PORT ttyS0 = 1200 bauds ---> ax0 = 0 = aprs /usr/local/sbin/kissattach $PTS0 aprs > /tmp/ax25-config.tmp awk '/device/ { print $7 }' /tmp/ax25-config.tmp > /tmp/ax25-config-tmp read Device < /tmp/ax25-config-tmp # /usr/local/sbin/kissparms -p aprs -r 250 -s 10 -l 20 -t 220 # Check for Device if [ -d /proc/sys/net/ax25/$Device ] then echo "Port aprs attached to $Device" cd /proc/sys/net/ax25/$Device/ # $Device parameters ifconfig $Device netmask 255.255.255.0 ifconfig $Device broadcast 0.0.0.0 else echo "** Error setting $Device parms **" fi # Port end # Attach KPC9612 TNC in kiss mode - on secondary PORT ttyS0 = 9600 bauds ---> ax1 = 1 = uhf-1 /usr/local/sbin/kissattach $PTS1 uhf-1 > /tmp/ax25-config.tmp awk '/device/ { print $7 }' /tmp/ax25-config.tmp > /tmp/ax25-config-tmp read Device < /tmp/ax25-config-tmp # /usr/local/sbin/kissparms -p uhf-1 -r 250 -s 10 -l 20 -t 220 # Check for Device if [ -d /proc/sys/net/ax25/$Device ] then echo "Port uhf-1 attached to $Device" cd /proc/sys/net/ax25/$Device/ # $Device parameters ifconfig $Device netmask 255.255.255.0 ifconfig $Device broadcast 0.0.0.0 else echo "** Error setting $Device parms **" fi # Port end #