Install paclink-unix
- Configure a single MTA
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
plu:example_config_files:systemd [2018/11/23 12:45] gunn |
plu:example_config_files:systemd [2018/11/23 15:55] (current) gunn |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== systemd files in /etc/systemd/system ===== | ===== systemd files in /etc/systemd/system ===== | ||
| + | * Up-to-date files can be found in nwdigitalradio/n7nix repo [[https://github.com/nwdigitalradio/n7nix/tree/master/systemd/sysd | here]] | ||
| === ax25dev.service === | === ax25dev.service === | ||
| <file> | <file> | ||
| Line 85: | Line 86: | ||
| </file> | </file> | ||
| ===== Files in /etc ===== | ===== Files in /etc ===== | ||
| + | * Up-to-date files can be found in nwdigitalradio/n7nix repo [[https://github.com/nwdigitalradio/n7nix/tree/master/systemd/sysd | here]] | ||
| === direwolf.conf === | === direwolf.conf === | ||
| <file> | <file> | ||
| Line 127: | Line 129: | ||
| CHANNEL 1 | CHANNEL 1 | ||
| - | PTT GPIO 12 | + | PTT GPIO 23 |
| MODEM 1200 | MODEM 1200 | ||
| MYCALL N7NIX-2 | MYCALL N7NIX-2 | ||
| Line 141: | Line 143: | ||
| </file> | </file> | ||
| ===== Files in /etc/ax25 ===== | ===== Files in /etc/ax25 ===== | ||
| + | * Up-to-date files can be found in nwdigitalradio/n7nix repo [[https://github.com/nwdigitalradio/n7nix/tree/master/systemd/ax25 | here]] | ||
| + | |||
| === ax25dev-parms === | === ax25dev-parms === | ||
| <file> | <file> | ||
| Line 200: | Line 204: | ||
| # portname set in /etc/ax25/axports | # portname set in /etc/ax25/axports | ||
| - | PORTNAME="udr0" | + | PORTNAME_1="udr0" |
| + | PORTNAME_2="udr1" | ||
| SERIALPORT_DIREWOLF="/tmp/kisstnc" | SERIALPORT_DIREWOLF="/tmp/kisstnc" | ||
| Line 207: | Line 212: | ||
| firmware_vendorfile="/sys/firmware/devicetree/base/hat/vendor" | firmware_vendorfile="/sys/firmware/devicetree/base/hat/vendor" | ||
| - | PROD_ID_NAMES=("INVALID" "INVALID" "UDRC" "UDRC II" "1WSpot") | + | PROD_ID_NAMES=("INVALID" "INVALID" "UDRC" "UDRC II" "DRAWS" "1WSpot") |
| NWDIG_VENDOR_NAME="NW Digital Radio" | NWDIG_VENDOR_NAME="NW Digital Radio" | ||
| Line 213: | Line 218: | ||
| # ===== function EEPROM id_check | # ===== function EEPROM id_check | ||
| + | |||
| # Return code: | # Return code: | ||
| # 0 = no EEPROM or no device tree found | # 0 = no EEPROM or no device tree found | ||
| Line 218: | Line 224: | ||
| # 2 = UDRC | # 2 = UDRC | ||
| # 3 = UDRC II | # 3 = UDRC II | ||
| - | # 4 = 1WSpot | + | # 4 = DRAWS |
| + | # 5 = 1WSpot | ||
| function id_check() { | function id_check() { | ||
| # Initialize to EEPROM not found | # Initialize to EEPROM not found | ||
| udrc_prod_id=0 | udrc_prod_id=0 | ||
| + | |||
| # Does firmware file exist | # Does firmware file exist | ||
| if [ -f $firmware_prodfile ] ; then | if [ -f $firmware_prodfile ] ; then | ||
| # Read product file | # Read product file | ||
| - | UDRC_PROD="$(cat $firmware_prodfile)" | + | UDRC_PROD="$(tr -d '\0' < $firmware_prodfile)" |
| # Read vendor file | # Read vendor file | ||
| - | FIRM_VENDOR="$(cat $firmware_vendorfile)" | + | FIRM_VENDOR="$(tr -d '\0' < $firmware_vendorfile)" |
| # Read product id file | # Read product id file | ||
| - | UDRC_ID="$(cat $firmware_prod_idfile)" | + | UDRC_ID="$(tr -d '\0' < $firmware_prod_idfile)" |
| #get last character in product id file | #get last character in product id file | ||
| UDRC_ID=${UDRC_ID: -1} | UDRC_ID=${UDRC_ID: -1} | ||
| Line 244: | Line 252: | ||
| udrc_prod_id=3 | udrc_prod_id=3 | ||
| ;; | ;; | ||
| - | "1WSpot") | + | "Digital Radio Amateur Work Station") |
| udrc_prod_id=4 | udrc_prod_id=4 | ||
| + | ;; | ||
| + | "1WSpot") | ||
| + | udrc_prod_id=5 | ||
| ;; | ;; | ||
| *) | *) | ||
| Line 278: | Line 289: | ||
| # ===== main ===== | # ===== main ===== | ||
| - | echo "ax25-upd: Start Port ${PORTNAME} with device ${SERIALPORT_DIREWOLF}" | + | echo "ax25-upd: Start Port ${PORTNAME_1} with device ${SERIALPORT_DIREWOLF}" |
| if [ -L $SERIALPORT_DIREWOLF ] ; then | if [ -L $SERIALPORT_DIREWOLF ] ; then | ||
| Line 284: | Line 295: | ||
| else | else | ||
| echo "Direwolf serial port NOT FOUND" | echo "Direwolf serial port NOT FOUND" | ||
| - | exit 1 | + | d exit 1 |
| fi | fi | ||
| Line 304: | Line 315: | ||
| pseudoterm=$($SBINDIR/mkiss $SERIALPORT_DIREWOLF /dev/ptmx none | tail -1) | pseudoterm=$($SBINDIR/mkiss $SERIALPORT_DIREWOLF /dev/ptmx none | tail -1) | ||
| echo "using mkiss with UDRC and pseudo term=$pseudoterm on port 1" | echo "using mkiss with UDRC and pseudo term=$pseudoterm on port 1" | ||
| - | $SBINDIR/kissattach ${pseudoterm} ${PORTNAME} 44.24.197.66 >/tmp/ax25-config.tmp | + | $SBINDIR/kissattach ${pseudoterm} ${PORTNAME_1} 44.24.197.66 >/tmp/ax25-config.tmp |
| kissattach_ret=$? | kissattach_ret=$? | ||
| + | dbgecho "kissattach return: $?" | ||
| + | /etc/ax25/ax25dev-parms ax0 | ||
| ;; | ;; | ||
| - | 3) | + | 3|4) |
| - | echo "UDRC II installed" | + | echo "UDRC II or DRAWS installed" |
| # use port 2 with mkiss | # use port 2 with mkiss | ||
| - | pseudoterm=$($SBINDIR/mkiss $SERIALPORT_DIREWOLF none /dev/ptmx | tail -1) | + | pseudoterm=$($SBINDIR/mkiss $SERIALPORT_DIREWOLF /dev/ptmx /dev/ptmx | tail -1) |
| - | echo "using mkiss with UDRC II and pseudo term=$pseudoterm on port 2" | + | echo "$pseudoterm" > /tmp/ax25-config.tmp |
| - | $SBINDIR/kissattach ${pseudoterm} ${PORTNAME} 44.24.197.66 >/tmp/ax25-config.tmp | + | pseudoterm_1=$(echo $pseudoterm | cut -d ' ' -f1) |
| + | pseudoterm_2=$(echo $pseudoterm | cut -d ' ' -f2) | ||
| + | echo "using mkiss with UDRC II and pseudo term_1: $pseudoterm_1 pseudo term_2: $pseudoterm_2" | ||
| + | $SBINDIR/kissattach ${pseudoterm_1} ${PORTNAME_1} 44.24.197.66 >/tmp/ax25-config_1.tmp | ||
| + | $SBINDIR/kissattach ${pseudoterm_2} ${PORTNAME_2} 44.24.197.67 >/tmp/ax25-config_2.tmp | ||
| kissattach_ret=$? | kissattach_ret=$? | ||
| + | dbgecho "kissattach return: $?" | ||
| + | /etc/ax25/ax25dev-parms ax0 | ||
| + | /etc/ax25/ax25dev-parms ax1 | ||
| + | echo " Port ${PORTNAME_1} attached to ax0" | ||
| + | echo " Port ${PORTNAME_2} attached to ax1" | ||
| ;; | ;; | ||
| - | 4) | + | 5) |
| echo "One Watt Spot installed" | echo "One Watt Spot installed" | ||
| # use port 1 with mkiss | # use port 1 with mkiss | ||
| pseudoterm=$($SBINDIR/mkiss $SERIALPORT_DIREWOLF /dev/ptmx none | tail -1) | pseudoterm=$($SBINDIR/mkiss $SERIALPORT_DIREWOLF /dev/ptmx none | tail -1) | ||
| echo "using mkiss with UDRC and pseudo term=$pseudoterm on port 1" | echo "using mkiss with UDRC and pseudo term=$pseudoterm on port 1" | ||
| - | $SBINDIR/kissattach ${pseudoterm} ${PORTNAME} 44.24.197.66 >/tmp/ax25-config.tmp | + | $SBINDIR/kissattach ${pseudoterm} ${PORTNAME_1} 44.24.197.66 >/tmp/ax25-config.tmp |
| kissattach_ret=$? | kissattach_ret=$? | ||
| + | dbgecho "kissattach return: $?" | ||
| + | /etc/ax25/ax25dev-parms ax0 | ||
| ;; | ;; | ||
| *) | *) | ||
| Line 328: | Line 352: | ||
| ;; | ;; | ||
| esac | esac | ||
| - | |||
| - | dbgecho "kissattach return: $?" | ||
| - | |||
| - | /etc/ax25/ax25dev-parms | ||
| # configure netrom | # configure netrom | ||
| Line 341: | Line 361: | ||
| echo "ax25-upd script finished" | echo "ax25-upd script finished" | ||
| exit 0 | exit 0 | ||
| + | </file> | ||
| + | === ax25-downd === | ||
| + | <file> | ||
| + | #!/bin/bash | ||
| + | # | ||
| + | SBINPATH="/usr/local/sbin" | ||
| + | |||
| + | echo "ax25-downd start" | ||
| + | # Stop FPAC | ||
| + | # /usr/local/sbin/myfpac.sh stop | ||
| + | |||
| + | # Stop Ax25 support | ||
| + | # for PROC_NAME in beacon ax25d ax25ipd ax25rtd mheardd listen saxIgate | ||
| + | for PROC_NAME in beacon ax25d ax25ipd ax25rtd mheardd saxIgate | ||
| + | do | ||
| + | PID=`/bin/pidof -x $PROC_NAME` | ||
| + | if [ -n "$PID" ]; then | ||
| + | kill -TERM $PID > /dev/null | ||
| + | echo "$PROC_NAME - $PID " | ||
| + | sleep 1 | ||
| + | fi | ||
| + | done | ||
| + | |||
| + | # If netromd is running | ||
| + | pidof netromd > /dev/null | ||
| + | if [ $? -eq 0 ]; then | ||
| + | |||
| + | # Save NetRom routes | ||
| + | $SBINPATH/nodesave -p $SBINPATH /var/ax25/nrsave && echo "N/R routes saved" | ||
| + | |||
| + | # Stop NetRom | ||
| + | killall netromd > /dev/null | ||
| + | echo "Netrom Stopped" | ||
| + | else | ||
| + | echo "Netrom daemon not running" | ||
| + | fi | ||
| + | |||
| + | # Close sockets | ||
| + | echo "Detach Ax/Nr/Sp Devices" | ||
| + | |||
| + | ifconfig|grep AMPR > /tmp/ax25-config.tmp | ||
| + | |||
| + | i=0 | ||
| + | iface=$(awk ' NR == '1' { print $1 }' /tmp/ax25-config.tmp) | ||
| + | |||
| + | while [ "$iface" != "" ] ; do | ||
| + | let i=i+1 | ||
| + | iface=$(awk ' NR == '$i' { print $1 }' /tmp/ax25-config.tmp) | ||
| + | if [ "$iface" != "" ] && [ "${iface:0:2}" == "nr" ] ; then | ||
| + | # echo "select: $iface, iface: ${iface:0:2}" | ||
| + | ifconfig "$iface" down | ||
| + | echo " $iface down" | ||
| + | fi | ||
| + | done | ||
| + | |||
| + | # Stop Kissattach | ||
| + | killall -KILL kissattach > /dev/null | ||
| + | # Empty Heard List | ||
| + | #cat /dev/null > /var/ax25/mheard/mheard.dat | ||
| + | |||
| + | # End of ax25-down | ||
| + | echo "ax25-downd finished" | ||
| + | exit 0 | ||
| + | </file> | ||
| + | === axports === | ||
| + | <file> | ||
| + | # /usr/local/etc/ax25/axports | ||
| + | # | ||
| + | # Use simple descriptive names for the ports, to make debugging | ||
| + | # other associated software easier. | ||
| + | |||
| + | # | ||
| + | # The format of this file is: | ||
| + | #portname callsign speed paclen window description | ||
| + | udr0 N7NIX-10 9600 255 2 Winlink | ||
| + | </file> | ||
| + | === ax25d.conf === | ||
| + | <file> | ||
| + | # /usr/local/etc/ax25/ax25d.conf | ||
| + | # | ||
| + | # ax25d Configuration File. | ||
| + | # | ||
| + | # | ||
| + | [N7NIX-10 VIA udr0] | ||
| + | NOCALL * * * * * * L | ||
| + | NOCALL * * * * * * L | ||
| + | default * * * * * * - rmsgw /usr/local/bin/rmsgw rmsgw -l debug -P %d %U | ||
| + | # | ||
| + | [N7NIX VIA udr0] | ||
| + | NOCALL * * * * * * L | ||
| + | default * * * * * * 0 gunn /usr/local/bin/wl2kax25d wl2kax25d -c %U -a %d | ||
| + | # | ||
| </file> | </file> | ||