User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

ax25 utils

Mon Jul 25, 2016 10:23 am

Hi all i have a big problem when i tied to execut mij script during boot up the kissattach command gets a sigterm and the ax0 and ax1 wil not be started

On mij other system its workin fine ( NOOBS ).
I have tied it strting it like a cron job an in lichtdm and in rc.local

What am i doing wrong

Code: Select all

#!/bin/bash
#
# - AX25 Stack
killall beacon &> /dev/null		# beacon
killall ax25d &> /dev/null		# ax25d
killall ax25rtd &> /dev/null		# ax25rtd
killall ax25ipd &> /dev/null		# ax25ipd
killall netromd &> /dev/null		# netromd
killall mheardd &> /dev/null		# mheardd
killall kissnetd &> /dev/null		# kissnetd
killall kissattach &> /dev/null		# kissattach
killall socat &> /dev/null		# socat
killall aprx &> /dev/null		# aprx
killall fbb &> /dev/null		# fbb
killall xfbbd &> /dev/null		# xfbbd
# - Net/Rom Interfaces
ifconfig nr0 down &> /dev/null		# nr0
ifconfig nr1 down &> /dev/null		# nr1
ifconfig nr2 down &> /dev/null		# nr2
ifconfig nr3 down &> /dev/null		# nr3
ifconfig nr4 down &> /dev/null		# nr4
clear
cp /etc/ax25/ax25ipd.conf.new /etc/ax25/ax25ipd.conf -f
modprobe ax25
modprobe netrom

tmpfile="/tmp/$$.start"
kissnetd -p2 > $tmpfile 2>/dev/null & disown
sleep 2

function attach() {
    read PTS1 PTS2
    echo "Starting ipd on $PTS1 and $PTS2"
    sleep 1
    sed -i "s,device /dev/.*$,device $PTS2," /etc/ax25/ax25ipd.conf
    ax25ipd
    sleep 1
    kissattach $PTS1 axudp 27.137.17.250 
}

tail -n 1 $tmpfile | attach
rm $tmpfile
#
# start radio poort
kissattach -l /dev/ttyAMA0 1 27.137.17.19
#
# modprobe netrom
#
# start netrom poorten en chat server
nrattach -i 27.137.17.251 netrom
#
nrattach -i 27.137.17.252 fbb
#
nrattach -i 27.137.17.253 netcht
#
ax25d
#
ax25rtd
#
mheardd -l -n 50
#
conversd
#
netromd -i -t 15 &
#
aprx
#
fbb
#
when i start it on the command line in ssh shel it seems to work somewhat but not perfect

Thanks Eddie

User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: ax25 utils

Thu Jul 28, 2016 7:08 am

Found it simply put the script in the /etc/init.d directori
and then enter update-rc.d ax25-start.sh defaults 95 5

Now it start up just fine on boot

:D

User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: ax25 utils

Thu Aug 04, 2016 9:07 pm

I also want to use Xnet by starting it with qemu-i386 and it starts however in my old linux i used ptyq0 and ttyq0 these ports are no longer availible in the debian jessie on PI what els can i use for this

User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: ax25 utils

Sun Aug 07, 2016 9:56 am

I found a way for the psuedo ports
Now i,m having the folowing problem Xnet is not hearing the packets from ax25.
Ax25 is hearing Xnet.
Mij ax2 board is telling me that the both are sending but for some reasen xnet is not hearing the packets

here is my start script and after the reboot i start xnet using qemu-i386 /xnet/linuxsnet

Code: Select all

#!/bin/bash
#
# - AX25 Stack
killall beacon &> /dev/null		# beacon
killall ax25d &> /dev/null		# ax25d
killall ax25rtd &> /dev/null		# ax25rtd
killall ax25ipd &> /dev/null		# ax25ipd
killall netromd &> /dev/null		# netromd
killall mheardd &> /dev/null		# mheardd
killall kissnetd &> /dev/null		# kissnetd
killall kissattach &> /dev/null		# kissattach
killall socat &> /dev/null		# socat
killall aprx &> /dev/null		# aprx
killall fbb &> /dev/null		# fbb
killall xfbbd &> /dev/null		# xfbbd
killall conversd &> /dev/null		# conversd
# - Net/Rom Interfaces
ifconfig nr0 down &> /dev/null		# nr0
ifconfig nr1 down &> /dev/null		# nr1
ifconfig nr2 down &> /dev/null		# nr2
ifconfig nr3 down &> /dev/null		# nr3
ifconfig nr4 down &> /dev/null		# nr4
clear
#
#
. /lib/lsb/init-functions
#
cp /etc/ax25/ax25ipd.conf.new /etc/ax25/ax25ipd.conf -f
modprobe ax25
modprobe netrom
modprobe mkiss
tmpfile="/tmp/$$.start"
/usr/local/sbin/kissnetd -p2 > $tmpfile 2>/dev/null & disown
sleep 2

function attach() {
    read PTS1 PTS2
    echo "Starting ipd on $PTS1 and $PTS2"
    sleep 1
    sed -i "s,device /dev/.*$,device $PTS2," /etc/ax25/ax25ipd.conf
    /usr/local/sbin/ax25ipd
    sleep 1
    /usr/local/sbin/kissattach $PTS1 axudp 27.137.17.250 
}

tail -n 1 $tmpfile | attach
rm $tmpfile
#
# start radio poort
/usr/local/sbin/kissattach /dev/ttyAMA0 1 27.137.17.19
#
# modprobe netrom
#
tmpfile="/tmp/$$.start"
/usr/local/sbin/kissnetd -p2 > $tmpfile 2>/dev/null & disown
sleep 2

function attach() {
    read PTS1 PTS2
    echo "Starting ipd on $PTS1 and $PTS2"
    sleep 1
    sed -i "s,attach sdev0 kiss 1 1 38400 /dev/.*$,attach sdev0 kiss 1 1 38400 $PTS2," /xnet/AUTOEXEC.NET
    cd /xnet
#    qemu-i386 /xnet/linuxsnet
    sleep 1
    /usr/local/sbin/kissattach -m 1580 $PTS1 axip 27.137.17.254
}

tail -n 1 $tmpfile | attach
rm $tmpfile
#
#
# start netrom poorten en chat server
/usr/local/sbin/nrattach -i 27.137.17.251 netrom
#
/usr/local/sbin/nrattach -i 27.137.17.252 fbb
#
/usr/local/sbin/nrattach -i 27.137.17.253 netcht
#
/usr/local/sbin/ax25d
#
/usr/local/sbin/ax25rtd
#
/usr/local/sbin/mheardd -l -n 50
#
conversd
#
netromd -i -t 15 &
#
aprx
#
fbb
#

User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: ax25 utils

Sat Aug 13, 2016 12:49 pm

I found a way to connect ax25-node to xnet using the axudp port

and also startup xnet using screen command
screen -D -m qemu-i386 /xnet/linuxsnet &

be aware that you first cd to the dir ware xnet is installed before you start xnet in my case cd /xnet
otherwise xnet can't find your AUTOEXEC.NET

User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: ax25 utils

Sat Aug 13, 2016 12:52 pm

this is now my startup script

Code: Select all

#!/bin/bash
#
# - AX25 Stack
killall beacon &> /dev/null		# beacon
killall ax25d &> /dev/null		# ax25d
killall ax25rtd &> /dev/null		# ax25rtd
killall ax25ipd &> /dev/null		# ax25ipd
killall netromd &> /dev/null		# netromd
killall mheardd &> /dev/null		# mheardd
killall kissnetd &> /dev/null		# kissnetd
killall kissattach &> /dev/null		# kissattach
killall socat &> /dev/null		# socat
killall aprx &> /dev/null		# aprx
killall fbb &> /dev/null		# fbb
killall xfbbd &> /dev/null		# xfbbd
killall conversd &> /dev/null		# conversd
# - Net/Rom Interfaces
ifconfig nr0 down &> /dev/null		# nr0
ifconfig nr1 down &> /dev/null		# nr1
ifconfig nr2 down &> /dev/null		# nr2
ifconfig nr3 down &> /dev/null		# nr3
ifconfig nr4 down &> /dev/null		# nr4
clear
#
#
. /lib/lsb/init-functions
#
cp /etc/ax25/ax25ipd.conf.new /etc/ax25/ax25ipd.conf -f
modprobe ax25
modprobe netrom
modprobe mkiss
tmpfile="/tmp/$$.start"
/usr/local/sbin/kissnetd -p2 > $tmpfile 2>/dev/null & disown
sleep 2

function attach() {
    read PTS1 PTS2
    echo "Starting ipd on $PTS1 and $PTS2"
    sleep 1
    sed -i "s,device /dev/.*$,device $PTS2," /etc/ax25/ax25ipd.conf
    /usr/local/sbin/ax25ipd
    sleep 1
    /usr/local/sbin/kissattach $PTS1 axudp 27.137.17.250 
}

tail -n 1 $tmpfile | attach
rm $tmpfile
#
# start radio poort
/usr/local/sbin/kissattach /dev/ttyAMA0 1 27.137.17.19
#
sleep 4
#
# tmpfile="/tmp/$$.start"
# /usr/local/sbin/kissnetd -p2 > $tmpfile 2>/dev/null & disown
# sleep 2
#
# function attach() {
#    read PTS3 PTS4
#    echo "Starting ipd on $PTS3 and $PTS4"
#    sleep 1
#    sed -i "s,attach sdev0 kiss 1 1 9600 /dev/.*$,attach sdev0 kiss 1 1 9600 $PTS3," /xnet/AUTOEXEC.NET
#    cd /xnet
#    qemu-i386 /xnet/linuxsnet
#    sleep 1
#    /usr/local/sbin/kissattach -m 1580 $PTS4 axip 27.137.17.254
# }
#
# tail -n 1 $tmpfile | attach
# rm $tmpfile
#
#
# start netrom poorten en chat server
/usr/local/sbin/nrattach -i 27.137.17.251 netrom
#
/usr/local/sbin/nrattach -i 27.137.17.252 fbb
#
/usr/local/sbin/nrattach -i 27.137.17.253 netcht
#
/usr/local/sbin/ax25d
#
/usr/local/sbin/ax25rtd
#
/usr/local/sbin/mheardd -l -n 50
#
conversd
#
netromd -i -t 15 &
#
cd /
#
cd /xnet
screen -D -m qemu-i386 /xnet/linuxsnet &
#
cd /
sleep 4
#
aprx
#
fbb
#

User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: ax25 utils

Mon Aug 22, 2016 10:54 am

now i'm fiddling with the the bbs software F6FBB the deamon works like dream but i have some isues with the grafic shell that runs under Xwindows i get a segmetation error

The writer of the program says it's becouse that it is made with obsolete libs
is there any one here that can rewrite this part of the code so it can be used in debian version 8 jessie kernal version 4.4.17+ armv6l
Attachments
2016-08-22-140828_768x580_scrot.png
2016-08-22-140828_768x580_scrot.png (44 KiB) Viewed 2139 times

User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: ax25 utils

Mon Aug 22, 2016 12:36 pm

as you can see in my previus post he takes up al of cpu time and when i tie to connect to the consol he comes back with a segmentation error
Attachments
2016-08-22-141334_768x580_scrot.JPG
2016-08-22-141334_768x580_scrot.JPG (47.39 KiB) Viewed 2139 times

User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: ax25 utils

Sat Sep 03, 2016 11:34 am

New problem i have a perl script that is not workin on the raspberry PI B+ with debian jessie

is there somthing i have to change in the script
m_filter

Code: Select all

#!/usr/bin/perl

require 5.000;

# FBB Word filter & 7PLUS capture
#
# Author:  Stewart Wilkinson G0LGS
#

#
# Nothing below here should need changing (unless its broken)
#

$Vers="0.60";
$VDate="20-Mar-2005";
$VData="M_Filter & 7PLUS capture for XFBB 7.01+ (c) 2005 by G0LGS V${Vers} ${VDate}.";

# Read Settings from FBBCONFIG
&ReadFBB_CFG;

# M_FILTER Config File.
$MYCFG="/usr/local/lib/fbb/filter/m_filter.cfg";
# $MYCFG="${CONF}/usr/local/lib/fbb/filter/m_filter.cfg"; 
$CONF="/usr/local/var/ax25/fbb";

# Wrong number of Parameters ?
if( $#ARGV < 4 ){
   printf STDERR "%s\n", ${VData};
   if( ! -f ${MYCFG} ){
      printf STDERR "WARNING: The Config File %s required by m_filter is missing or unreadable.\n", ${MYCFG};
      printf STDERR "Please correct the problem, as Message Filtering will not work without it.\n";
   }
   exit 0;
}

# The Parameters
$Mesg=$ARGV[0];
$Type=$ARGV[1];
$From=$ARGV[2];
$To=$ARGV[3];
$RecNo=$ARGV[4];	# Seems to Always be 0 in XFBB.

# Date / Time
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = localtime(time);
$SEC=("00".."59")[$sec];
$MIN=("00".."59")[$min];
$HOUR=("00".."23")[$hour];
$MDAY=("00".."31")[$mday];
$MON=("01".."12")[$mon];
$YEAR=("00".."99")[$year % 100];

# Weekly Log File Name
$week=int((${yday}+1) / 7);
$WK=("00".."53")[$week];
$LOGF="${DATA}/log/mftlog.${WK}";

# Some Default Values / Settings
$Subject="(no subject)";
$AUTO7PLUS=1;
$KMAIL=1;
$HMAIL=1;
$LOG=1;
$CAPT="/usr/local/lib/fbb/filter/m_filter.fwd";

# Read our Config file & build our list of search words.
&ReadMY_CFG;

# Don't try to trap our own Messages, as that will cause an endless loop
if( (${From} =~ /^${WHOAMI}$/) && (${To} =~ /^${SYSCALL}$/ )  ){
   exit 0;
}

# Do we Check Private Messages ?
if( ($Type =~ /p/i) && (!defined($CHECKPRIVATE) || (! $CHECKPRIVATE) ) ){
   exit 0;
}

$Hold=0;
$Kill=0;
$Found="";

# Check To:
foreach $A (@ToFl) {
   if( ${To} =~ /(${A})/i) {
      $Found="$1";
      $line=${To};
      $Hold=1;
      last;
   }
}
if( ${Hold} ){
   &DoMsg("Held","To");
   exit 3;
}

# Check From:
foreach $A (@FmFl) {
   if( ${From} =~ /(${A})/i) {
      $Found="$1";
      $line=${From};
      $Hold=1;
      last;
   }
}
if( ${Hold} ){
   &DoMsg("Held","From");
   exit 3;
}

# Subject / Message ID Checking

# Open dirmes.sys
if( open(DIRMES, '<', ${DIRMES} ) ) {

   # Move to the appropriate Record
   # (Always seems = 0 in XFBB).
   seek(DIRMES, ${RecNo} * 194, 0);

   # Read the Record
   if( read( DIRMES, $Rec, 194 ) == 194 ) {

      # Extract Data from Record.
      ($type,$Stat,$Num,$Size,$Date,$Adjbbs,$Route,$Destn,$to,$MID,$Subject,$Resv,$Crdate,$Stdate,$Bbs1,$Bbs2) =
      unpack("Z Z L L L Z7 Z41 Z7 Z7 Z13 Z61 Z16 L L A10 A10", $Rec);

      # Check Message ID
      foreach $M (@Mid) {
         if( ${MID} =~ /(${M})/i) {
            $Found="$1";
            $Hold=1;
            last;
         }
      }

      if( ${Hold} ){
         &DoMsg("Held", "MID");
         exit 3;
      }

      # Check Subject
      foreach $A (@Subj) {
         if( ${Subject} =~ /(${A})/i) {
            $Found="$1";
            $Hold=1;
            last;
         }
      }

      #Check for Kill Words
      foreach $KILL (@Kill) {
         if( ${Subject} =~ /(${KILL})/i) {
            $Found="$1";
            $Kill=1;
            last;
         }
      }

      if(${Kill}){
         &DoMsg("Killed", "Subject");
         exit 1;
      }

      # Check for Hold Words
      foreach $HOLD (@Hold) {
         if( ${Subject} =~ /(${HOLD})/i) {
            $Found="$1";
            $Hold=1;
            last;
         }
      }

      if( ${Hold} ){
         &DoMsg("Held", "Subject");
         exit 3;
      }

   }

   close(DIRMES);
}

# Open the Message.
if( ! open( MESG, '<', ${Mesg} ) ){
   printf STDERR "Unable to open Message '%s'\n", ${Mesg};
   exit 0;
}

# Check R: Lines
$Pos = tell(MESG);
while(($line = <MESG>) ){
   chomp($line);

   # Is this an R-Line ?
   if( $line =~ /^R\:\d{6,}\/\d{4}[zZ]{0,1}\s+\d*\@[\:]{0,1}(\S+)/i ) {

      if( !defined(${Via}) ) {
         $Via = $1;
         $Via =~ /^(\w*)\.(.*)$/;
         $via = $1;
      }

      foreach $RL (@Rlin) {
         if( $line =~ /(${RL})/i) {
            $Found="$1";
            $Hold=1;
            last;
         }       
      }
      if( $Found ){
         last;
      }

      foreach $KILL (@Kill) {
         if( $line =~ /(${KILL})/i) {
            $Found="$1";
            $Kill=1;
            last;
         }
      }
      if( $Found ){
         last;
      }

      foreach $HOLD (@Hold) {
         if( $line =~ /(${HOLD})/i) {
            $Found="$1";
            $Hold=1;
            last;
         }
      }
      if( $Found ){
         last;
      }

   # No more R:Lines
   }else{
      seek(MESG, $Pos, 0);
      last;
   }

}continue{
   $Pos = tell(MESG);
}

if( ${Kill} ){
   &DoMsg("Killed", "R-line");
   close(MESG);
   exit 1;
}

if( ${Hold} ){
   &DoMsg("Held", "R-line");
   close(MESG);
   exit 3;
}

$Is7plus=0;

# Check for 7PLUS
if( defined(${AUTO7PLUS}) && ${AUTO7PLUS} ) {

   # Check if this the Message has any 7plus
   $Pos = tell(MESG);
   while($line = <MESG>){
      chomp($line);

      # Translate 'non-printable' characters to '.'
      $line =~ s/[\x01-\x1f]/\./g;
      $line =~ s/[\x80-\xff]/\./g;

      # Ignore blank lines
      if( $line =~ /^\s*$/ ){
         next;
      }elsif( $line =~ /\_7\+/ ){
         ${Is7plus} = 1;
         last;
      }
   }
   seek(MESG, ${Pos}, 0);

   # Append to 'mfilter.fwd' file
   if( ${Is7plus} ){
      if( open( CAPT, '>>', ${CAPT} ) ){

         # Message Header
         printf CAPT "SP %s \< %s\n", ${To}, ${From};
         printf CAPT "%s\n", ${Subject};      

         # Start at top Of Message
         seek(MESG, 0, 0);
         # Append to file
         print CAPT <MESG>;

         # Reset MESG pointer for rest of checks.
         seek(MESG, ${Pos}, 0);

         printf CAPT "/EX\n";
         close(CAPT);
      }
   }
}

# Check the Message Text
$Pos = tell(MESG);

while($line = <MESG>){
   chomp($line);

   # Translate 'non-printable' characters to '.'
   $line =~ s/[\x01-\x1f]/\./g;
   $line =~ s/[\x80-\xff]/\./g;

   # Ignore blank lines
   if( $line =~ /^\s*$/ ){
      next;
   }

   # Check for Kill Words
   foreach $KILL (@Kill) {
      if( $line =~ /(${KILL})/i) {
         $Found="$1";
         $Kill=1;
         last;
      }
   }
   if($Found){
      last;
   }

   # Check for Hold Words
   foreach $HOLD (@Hold) {
      if( $line =~ /(${HOLD})/i) {
         $Found="$1";
         $Hold=1;
         last;
      }
   }

   if($Found){
      last;
   }
}continue{
   $Pos = tell(MESG);
}

if(${Kill}){
   &DoMsg("Killed", "Message");
   close(MESG);
   exit 1;
}

if(${Hold}){
   &DoMsg("Held", "Message");
   close(MESG);
   exit 3;
}

close(MESG);

# Message Check complete / Tell XFBB to accept message
exit 0;

# Functions used above

# Generate LOG Entry / SYSOP Message

sub DoMsg
{
   local( $Action ) = $_[0];
   local( $Where ) = $_[1];

   if( defined(${LOG}) && ${LOG} ){
      if( open(LOG, '>>', ${LOGF} ) ) {

         if( defined($via) ) {
            printf LOG "%02d/%02d/%02d %02d:%02d:%02d %s Fm:%s To:%s Via:%s Fnd:%s in %s\n", ${MDAY}, ${MON},${YEAR},${HOUR},${MIN},${SEC}, ${Action}, ${From}, ${To}, ${via}, ${Found}, ${Where};
         }else{ 
            printf LOG "%02d/%02d/%02d %02d:%02d:%02d %s Fm:%s To:%s Fnd:%s in %s\n", ${MDAY}, ${MON},${YEAR},${HOUR},${MIN},${SEC}, ${Action}, ${From}, ${To}, ${Found}, ${Where};
         }

         close(LOG);
      }
   }

   # Generate SYSOP Message ?

   if(   ( (${Action} =~ /^killed/i) && (defined(${KMAIL}) && ${KMAIL}) ) 
      || ( (${Action} =~ /^held/i  ) && (defined(${HMAIL}) && ${HMAIL}) )  ) {

      if( open(LOCK, '>', ${LOCK} ) ) {

         printf LOCK "$$";

         if( open(MAIL, '>>', ${MAIL} ) ){

            printf MAIL "SP %s < %s\n", ${SYSCALL}, ${WHOAMI};
            printf MAIL "Message from: %s ${Action}\n\n", ${From};
            printf MAIL "%s\n\n", ${VData};

            if( $Where =~ /^Message/i ){            

               printf MAIL "Message From: %s To: Q%sQ - %s because %s contained:\n", ${From}, ${To}, ${Action}, ${Where};
               printf MAIL "the word or phrase 'Q%sQ' in the following line from the message:-\n\n", ${Found};
               printf MAIL "%s\n\n", ${line};

            }elsif( $Where =~ /^Subject/i ){            

               printf MAIL "Message From: %s To: Q%sQ - %s because %s contained\n", ${From}, ${To}, ${Action}, ${Where};
               printf MAIL "the word or phrase 'Q%sQ' (Subect: 'Q%sQ')\n\n", ${Found}, ${Subject};

            }else{

               printf MAIL "Message From: %s To: %s - %s because %s contained\n", ${From}, ${To}, ${Action}, ${Where};
               printf MAIL "the word or phrase 'Q%sQ'\n\n", ${Found};

            }

            if( defined(${Via}) ) {
               printf MAIL "\nThe message was forwarded from 'Q%sQ'\n\n", ${Via};
            }

            printf MAIL "/EX\n";
            close(MAIL);
         }

         close(LOCK);
         unlink(${LOCK});
      }
   }
}

sub IsEnabled
{
   local($Ret) = 0;
   local($P) = $_[0];

   if( ($P =~ /^0/) || ($P =~ /^n\S*/i) || ($P =~ /^off/i) || ($P =~ /^di\S*/i) ){
         ${Ret}=0;

   }elsif( ($P =~ /^1/) || ($P =~ /^y\S*/i) || ($P =~ /^ok/i) || ($P =~/^on/i) || ($P =~ /^en\S*/i) ){
         ${Ret}=1;

   }

   return ${Ret};
}

sub ReadFBB_CFG
{
   # Where is FBB Config File
   $FBBCONF="/usr/local/etc/ax25/fbb/fbb.conf";

   if( defined( $ENV{FBBCONF} ) && "$ENV{FBBCONF}" != "" ){
      $FBBCONF = $ENV{FBBCONF}
   }

   # Read things we need from FBB Config file
   if(! open( FBBCONF, '<', $FBBCONF) ) {
      printf STDERR "Unable to open '%s'\n", ${FBBCONF};
      exit 1;
   }

   while($line = <FBBCONF>) {

      chomp($line);

      if( $line =~ /^\s*\#/) {
         next;

      }elsif( $line =~ /^\s*$/) {
         next;

      }else{
         $line =~ /^\s*(\S*)\s*\=\s*(.*)$/;
         $item = $1;
         $value = $2;

         if( $item =~ /^callsign/ ){
            $value =~ /^(\w*)\.(.*)$/;
            $BBSCALL = $1;
            $BBSHR = $2;
            $WHOAMI = $BBSCALL;

         }elsif( $item =~ /^data/ ){
            $value =~ /^(\S*)$/;
            $DATA = $1;
            $DIRMES="${DATA}/dirmes.sys";

         }elsif( $item =~ /^conf/ ){
            $value =~ /^(\S*)$/;
            $CONF = $1;

         }elsif( $item =~ /^name/ ){
            $value =~ /^(\S*)$/;
            $NAME = $1;

         }elsif( $item =~ /^syso/ ){
            $value =~ /^(\S*)$/;
            $SYSCALL = $1;

         }elsif( $item =~ /^impo/ ){
            $value =~ /^([^\.]\S*)\.(\S*)$/;
            $MAIL = "$1.$2";
            $LOCK = "$1.lck";
         }
      }
   }

   close(FBBCONF);

}

sub ReadMY_CFG
{

   if( ! open( MYCFG, '<', ${MYCFG} ) ) {
      if( ! -f "${CONF}/m_filter.warn" ){
         if( open(LOCK, '>', ${LOCK} ) ) {
            printf LOCK "$$";

            if( open(MAIL, '>>', ${MAIL} ) ){
               printf MAIL "SP %s < %s\n", ${SYSCALL}, ${WHOAMI};
               printf MAIL "WARNING: M_Filter Config Error\n\n";
               printf MAIL "The Config File %s required by m_filter is missing or unreadable.\n", ${MYCFG};
               printf MAIL "Please correct the problem, as Message Filtering will not work without it.\n";
               printf MAIL "/EX\n";
               close(MAIL);
            }
            close(LOCK);
            unlink(${LOCK});
         }

         if( open(WRN, '>', "${CONF}/m_filter.warn" ) ){
            print WRN "m_filter is not correctly configured !";
            close WRN;
         }

      }

      exit 0;
   }

   if( -f "${CONF}/m_filter.warn" ){
      unlink( "${CONF}/m_filter.warn" );
   }

   $Subj=0;
   $Rlin=0;
   $ToFl=0;
   $FmFl=0;
   $Hold=0;
   $Kill=0;
   $Mid=0;

   while(<MYCFG>) {
      chomp;

      # Comments
      if( /^\s*\;/ ) {
         next;

      }elsif( /^\s*\#\S*/ ){
         next;

      # Blank Lines
      }elsif( /^\s*$/ ) {
         next;

      # Generate Filter message for Held Messages ?
      }elsif( /^\s*\!\s*MAIL\s*\=\s*(\S*)/ ){
         $HMAIL = &IsEnabled($1);
         next;

      # Generate Filter message for Killed Messages ?
      }elsif( /^\s*\!\s*KMAIL\s*\=\s*(\S*)/ ){
         $KMAIL = &IsEnabled($1);
         next;

      # 7PLUS Capture ?
      }elsif( /^\s*\!\s*AUTO7PLUS\s*\=\s*(\S*)/ ){
         $AUTO7PLUS = &IsEnabled($1);
         next;

      # CHECK PRIVATE Messages ?
      }elsif( /^\s*\!\s*CHECKPRIVATE\s*\=\s*(\S*)/ ){
         $CHECKPRIVATE = &IsEnabled($1);
         next;

      # FBB m_filter.fwd (for 7plus AutoCapture)
      }elsif( /^\s*\!\s*7PLUS\s*\=\s*(\S*)/ ){
         $CAPT="$1";

      # FILTER Messages From:
      }elsif( /^\s*\!\s*WHOAMI\s*\=\s*(\S*)/ ){
         $WHOAMI = $1;

      # Logging ?
      }elsif( /^\s*\!\s*LOG\s*\=\s*(\S*)/ ){
         $LOG = &IsEnabled($1);
         next;

      # Kill Words / Phrases
      }elsif( /^\s*\!\sKILL/i ) {
         $Subj=0;
         $Rlin=0;
         $ToFl=0;
         $FmFl=0;
         $Hold=0;
         $Kill=1;
         $Mid=0;

      # Hold Words / Phrases
      }elsif( /^\s*\!\sHOLD/i ) {
         $Subj=0;
         $Rlin=0;
         $ToFl=0;
         $FmFl=0;
         $Hold=1;
         $Kill=0;
         $Mid=0;

      # R:Line Words / Phrases
      }elsif( /^\s*\!\sRLINE/i ) {
         $Subj=0;
         $Rlin=1;
         $ToFl=0;
         $FmFl=0;
         $Hold=0;
         $Kill=0;
         $Mid=0;

      # To Calls to Check
      }elsif( /^\s*\!\sTO/i ) {
         $Subj=0;
         $Rlin=0;
         $ToFl=1;
         $FmFl=0;
         $Hold=0;
         $Kill=0;
         $Mid=0;

      # From Calls to Check
      }elsif( /^\s*\!\sFROM/i ) {
         $Subj=0;
         $Rlin=0;
         $ToFl=0;
         $FmFl=1;
         $Hold=0;
         $Kill=0;
         $Mid=0;

      # Additional Subject Words
      }elsif( /^\s*\!\sSUBJECT/i ) {
         $Subj=1;
         $Rlin=0;
         $ToFl=0;
         $FmFl=0;
         $Hold=0;
         $Kill=0;
         $Mid=0;

      # Message ID's
      }elsif( /^\s*\!\sMID/i ) {
         $Subj=0;
         $Rlin=0;
         $ToFl=0;
         $FmFl=0;
         $Hold=0;
         $Kill=0;
         $Mid=1;

      # Ignore unknown config lines.
      }elsif( /^\s*\!\S*/i ) {
         next;

      }else{
         # Format Word / Phrase for PERL Regular Expression Handling.

         # Add '\' escapes to some special characters
         s/([\#\!\@\:\[\]\\\/\.\*\?])/\\$1/g;

         # Change any ' ' to '\s{1}' (match exactly 1 space)
         s/\ /\\s{1}/g;

         # Insert Temporary Leading Space (so that some of the remaining
         # checks work at the begining of the line)
         $_ = " " . $_;

         # Change '+', but not '%+' to '\b' (word boundary)
         s/([^%])\+/$1\\b/gx;

         # Change '%+' to '\+'
         s/%\+/\\+/g;

         # Change '_', but not '%_' to '\s+' (one or more spaces)
         s/([^%])_/$1\\s+/gx;

         # Change '%_' to '_'
         s/%_/_/g;

         # Change '%d' to '\d'	(decimal number)
         s/%d/\\d/gi;

         # Change '%s' to '\S'	(non-space char)
         s/%s/\\S/gi;

         # Remove Leading Space
         s/^\ //;

         if($Subj){
            push( @Subj, $_ );

         }elsif($Rlin){
            push( @Rlin, $_ );

         }elsif($ToFl){
            push( @ToFl, $_ );

         }elsif($FmFl){
            push( @FmFl, $_ );

         }elsif($Hold){
            push( @Hold, $_ );

         }elsif($Kill){
            push( @Kill, $_ );

         }elsif($Mid){
            push( @Mid, $_ );
         }
      }
   }

   close(MYCFG);
}  
and here is my m_filter.cfg

Code: Select all

; This is the config file for G0LGS's M_FILTER for Linux XFBB.
; Blank lines are ignored as are lines starting with a ';' or '#'

; Config Options (yes/ok/on/1/en = Enable, no/off/0/di = Disable);
! MAIL = no		; Tell Sysop about Held Mail (Default = yes)
! KMAIL = no		; Tell Sysop about Killed Mail (Default = yes)
! CHECKPRIVATE = yes	; Do we Check Private Messages ?
! AUTO7PLUS = yes	; Do we Auto Collect 7plus (default = yes)
! 7PLUS = /usr/local/lib/fbb/filter/m_filter.fwd
                        ; Where to place 7plus Extracts.
                        ; Default = /usr/local/lib/fbb/filter/m_filter.fwd
! WHOAMI = NL4PRC       ; From 'Callsign' for FILTER Messages
                        ; Default = FILTER  (V0.5x)
                        ;           BBSCall (from V0.60)
! LOG = yes             ; Enable Logging (default = yes)

; Lines beyond this point which start with '!' are important
; and MUST NOT be removed or changed.

; Each line should be a word (or partial word) or even a phrase to 
; look for (Not case sensitive).
; Use '_' to match one or more spaces in middle of a word or phrase.
; ( use '%_' to match a real '_' )
; Use a space (' ') where you want to match exactly one space.
; you can also use:
; +word		match at begining of word
; word+		match at end of word
; +word+	match whole word only
; (use '%+' to match a real '+')
;
; These should also work:
; ^word		match ONLY at start of a line.
; word$		match ONLY at end of a line.
;
; These are available from V0.52 :
; %d		decimal number
; %d{m}		decimal number exactly m digits long
; %d{m,}	decimal number m or more digits long
; %d{m,n}	decimal number between m & n digits long
; %s		any string (except space)
; %s{m}		any string exactly m chars long
; %s{m,}	any string m or more chars long
; %s{m,n}	any string between m & n chars long

; Kill These on sight !!
! KILL

;

; Hold These for review
! HOLD
ABUSE+
abuse+
abuse!+
ABUSE!+
+Doorgestuurd bericht+
+login password+

; Additional Hold Words for Subject
; The Subject are checked for HOLD/KILL words plus anything listed here:
! SUBJECT
Filer's_Files
; Hold on From: Field
! FROM
; Examples:
; Any Italian Callsign
;I%s{0,1}%d{1,2}%s{1,3}
; Any German Callsign
;D%s{0,1}%d{1,2}%s{1,3}
; UK Calligns
;G%s{0,1}%d{1}%s{1-3}
;M%s{0,1}%d{1}%s{1-3}
;2%s{1}%d{1}%s{1-3}

; Hold on To: Field
! TO

; Hold on R: line
; (R: Lines gets checked for HOLD/KILL words plus anything listed here).
! RLINE
;
; Old messages
;
^R:99%d{4}/%d{4}%s{0,1}[email protected]:%s{1,}
^R:00%d{4}/%d{4}%s{0,1}[email protected]:%s{1,}
^R:01%d{4}/%d{4}%s{0,1}[email protected]:%s{1,}
^R:02%d{4}/%d{4}%s{0,1}[email protected]:%s{1,}
^R:03%d{4}/%d{4}%s{0,1}[email protected]:%s{1,}
;
; non-Y2K R-lines
;
^R:101%d{4}/%d{4}%s{0,1}[email protected]:%s{1,}
^R:102%d{4}/%d{4}%s{0,1}[email protected]:%s{1,}
^R:103%d{4}/%d{4}%s{0,1}[email protected]:%s{1,}
^R:104%d{4}/%d{4}%s{0,1}[email protected]:%s{1,}
^R:105%d{4}/%d{4}%s{0,1}[email protected]:%s{1,}
;
; CB Systems:
;
; NL3DHR.NH.NLD.EU
;
; EA8EE has been sending Internet newsgroups, so check all messages
; passing through his system.
;
EA8EE
;

; Hold on Message ID - Requires V0.60
! MID
%d{1,6}%_XXXXXX
%d{1,6}-XXXXXX 

User avatar
scruss
Posts: 2628
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: ax25 utils

Sat Sep 03, 2016 2:50 pm

Unfortunately, I'm not surprised you're getting no hits to your questions on AX25. Packet radio has almost disappeared over the last decade. Even APRS has big holes in FM repeater coverage in North American cities.

You might be able to built xfbb for yourself with if you install the lesstif2-dev and libax25-dev packages. As for your Perl script, what error messages does it give? It looks like the sort of horrid non-structured code I was debugging (and sadly, creating more of) in the late 1990s. It looks like there are some hard-coded paths that have been changed by a particular user all over the script, and some of the routines look like they'd fail quietly if they couldn't read or write the file.

73 de VA3PID
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: ax25 utils

Sat Sep 03, 2016 7:15 pm

no errors when starting it by hand

[email protected]:/usr/local/lib/fbb/filter# ./m_filter
M_Filter & 7PLUS capture for XFBB 7.01+ (c) 2005 by G0LGS V0.60 20-Mar-2005.
[email protected]:/usr/local/lib/fbb/filter#

the 7plus capture works but the rest of filtering for keywords in the mails is not

User avatar
scruss
Posts: 2628
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: ax25 utils

Sat Sep 03, 2016 7:33 pm

It opens a log somewhere; anything in that?
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: ax25 utils

Sun Sep 04, 2016 9:15 am

yess there is one it say's that it is filtering but the messages ar not put on held in fbb
Maybe its not a m_filter problem but a fbb fault

03/09/16 13:40:02 Held Fm:EFER18 To:FUNK Via:NL3PRC Fnd:login password in Message
03/09/16 21:11:36 Held Fm:CB2PRC To:TEST Fnd:abuse in Subject
03/09/16 21:20:32 Held Fm:CB2PRC To:TEST Fnd:abuse in Subject

Return to “Beginners”