fbb start file for linux

Fbb start file

#! /bin/bash
### BEGIN INIT INFO
# Provides:          F6FBB Start-up
# Required-Start:    $remote_fs $syslog $network
# Required-Stop:     $remote_fs $syslog $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: FBB start up
# Description:       This script provides the start/stop control
#                    for the FBB BBS Packet Radio BBS.
### END INIT INFO

export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/etc/ax25:/usr/local/etc/ax25:/usr/local/xnet

base=${0##*/}
link=${base#*[SK][0-9][0-9]}

test $link = $base && START_FBB=yes
test "$START_FBB" = yes || exit 0
test -x /usr/local/sbin/fbb || exit 0

return="Done"
case "$1" in
start)
        echo "Starting FBB daemon "
        if [ -f /usr/local/etc/ax25/fbb/fbb.conf ] ; then
                /usr/local/sbin/fbb -s -a -l /etc/ax25/fbb.log || return=$rc_failed
        else
                echo  "/usr/local/etc/ax25/fbb/fbb.conf file not found"
                return="Failed"
        fi
        echo  " $1 $return"
        ;;
stop)
        echo "Shutting down FBB script"
        killall -KILL fbb || return="Failed"
        echo "Shutting down FBB daemon"
        killall -KILL xfbbd || return="Failed"
        sleep 4
        echo  " $1 $return"
        ;;
restart|reload)
        $0 stop && $0 start
        ;;
status)
        echo -n "Checking for FBB daemon: "
        PID=`/bin/pidof -x xfbbd`
        if [ -n "$PID" ]; then
                echo  "FBB is up"
         else
                echo "No FBB daemon"
        fi
        ;;


*)
        echo "Usage: $0 {start|stop|status|restart}"
        exit 1
esac

exit 0

Linfbb port.sys

Voorbeeld van port.sys die ik gebruik voor pi8lap

# BBS port.sys
#
# Number of Com Ports (not including Com 0) and TNCs
  3      10
#
# Interface 7 = TCPIP
# Interface 9 = LINUX
#
#Com Interface Adress (Hex)  Baud
 1   9           0       115200
 2   9        189C         0
 3   9        189D:189E:77       0
#
# Maxframe: The maximum number of frames the TNC will send at a time.
# NbFwd   : Number of channels for OUTGOING forward at the same time.
# MxBloc  : Size of forward-block in Kb.
#
# M/P-Fwd : Minute of the hour for start of forward, and period
#           (how many minutes between each forward-start).
# Mode    : One of these:
#           B : BBS-mode.
#           G : "Guest"-mode.
#           U : Normal-mode.
# Type host-mode, one of these:
#           D : WA8DED
#           K : KAM hostmode.
#           M : Telephone-modem.
#           P : PK-232
#           Q : BPQ v 4.x
# Addition: One of these letters can be used too:
#           L : Send unproto beacon after each arriving mail.
#           Y : Yapp allowed on this QRG.
#           W : Gateway allowed TO this QRG.
#           R : Read-Only acces.
#           E : Recommanded by JP F6FBB
#
# Freq.   : Text to describe this port (max 9 characters, no space)
# Same number of lines as number of TNCs.
#
#TNC NbCh Com MultCh   Pacln Maxfr NbFwd MxBloc M/P-Fwd  Mode  Freq
  0   0    0   0        0     0     0     0      00/01   ----  File-fwd.
  1   4    1   ax0      128   4     2     10     15/60   XULWY 144.850
  2   4    1   ax1      128   4     2     10     15/60   XULWY 430.950
  3   4    1   ax2      128   4     2     10     15/60   XULWY Node
  4   10   2   0        250   7     4     10     15/15   TUY   Telnet
  5   10   1   nr1      250   4     2     10     30/15   XUWY  NetRom
  6   10   3   0        250   7     4     10     00/10   SU    Pop/smtp
  7   10   1   rose0    250   4     4     10     30/15   XUWY  Rose
  8   10   1   ax4      250   4     4     10     30/15   XUWY  Axudp
  9   10   1   ax5      250   4     4     10     30/15   XUWY  Axip
 10   10   1   ax6      250   4     4     10     30/15   XUWY  Jnos
#
# Special callsigns and modes for some channels
# TNC Nbs Callsign-SSID Mode
# 1    2   XXXXX-1       B
#
# End of file

 

Monitor script F6fbb

Brain N1URO has written a script to see if fbb is still running.
I saved this script in the fbb directory.
/usr/local/etc/ax25/fbb

Have it saved as “fbbcheck” now it is possible to call it via a cronjob every hour.

Edit the /etc/crontab file and add the following.

15 *    * * *   root    /usr/local/etc/ax25/fbb/fbbcheck

Now, every 15 minutes after the full hour, it is checked whether fbb is still running, otherwise it will be restarted.

Here under the “fbbcheck” script.

#! /bin/sh

. /lib/lsb/init-functions

MYFBB=`ps ax|grep fbb|grep xfbbd|grep sbin|awk '{ print $1 }'`
PID=`ps ax|grep fbb|grep xfbbd|grep sbin|awk '{ print $1 }'`

if [ -z $MYFBB ]
  then
   log_warning_msg "FBB BBS not found running"
   sleep 2
   log_action_msg "Reloading FBB... "
   sleep 2
   /usr/local/sbin/fbb -s -a
   log_daemon_msg "FBB Reloaded" "done"
   log_end_msg 0

exit 1
fi
  log_action_msg "FBB PBBS is running on pid: $PID"
  exit 0

Tnx to Brain N1URO
http://n1uro.ampr.org/

I made a small addition to the script myself. Now I can also see how long fbb has been running and when fbb has been started. (just fun )

#! /bin/sh

. /lib/lsb/init-functions

MYFBB=`ps ax|grep fbb|grep xfbbd|grep sbin|awk '{ print $1 }'`
PID=`ps ax|grep fbb|grep xfbbd|grep sbin|awk '{ print $1 }'`
UPTIME=`ps -p $PID -o %t | tail -1|awk '{ print $1 }'`
START=`ps -p $PID -o lstart=`

if [ -z $MYFBB ]
  then
   log_warning_msg "FBB BBS not found running"
   sleep 2
   log_action_msg "Reloading FBB... "
   sleep 2
   /usr/local/sbin/fbb -s -a
   log_daemon_msg "FBB Reloaded" "done"
   log_end_msg 0

exit 1
fi
  log_action_msg "FBB BBS PI8LAP is running on pid : $PID"
  log_action_msg "FBB BBS PI8LAP is Started on : $START"
  log_action_msg "FBB BBS PI8LAP is running for : $UPTIME dd:hh:mm:ss"
exit 0

Looks like this.

root@pi1lap-base:/usr/local/etc/ax25/fbb# ./fbbcheck
[info] FBB BBS PI8LAP is running on pid : 2573.
[info] FBB BBS PI8LAP is Started on : Sat Sep  2 06:23:02 2017.
[info] FBB BBS PI8LAP is running for : 01:10:44 dd:hh:mm:ss.
root@pi1lap-base:/usr/local/etc/ax25/fbb#

Examples forward JNOS/BPQ/LinFBB

Here below some examples how the configuration of the forward in different systems works.

Thanks in particular to Bob (VE3TOK) and Gus (I0OJJ) for example configs !

Copyright ©  http://www.langelaar.net/jnos2/

Example Configuration for JNOS 2.0k side
   ----------------------------------------

      a) autoexec.nos

         # regular listener (no IAC) for remote JNOS and BPQ systems
         start telnet

         # another listener (IAC) on different port for LINFBB and OBCM systems
         start telnet 6300 iac

         # for winlink secure login, you have to configure your callsign
         mbox winlinkcall ve4klm

      b) spool/forward.bbs

         -------
         ve3tok
         # Here we are talking to a remote LINFBB system
         telnet 44.x.y.z 6300 iac
         +Callsign :
         .ve4klm
         +Password :
         .BLAHBLAHBLAH
         ve3tok
         -------
         va3tok
         # Here we are talking to a remote BPQ system
         telnet 44.x.y.z 8011 cronly
         .ve4klm
         .BLAHBLAHBLAH
         +BPQ
         .BPQBBS
         va3tok
         -------
         wl2k
         # Here we are talking to Winlink CMS server
         telnet winlink.org 8772 cronly
         +Callsign :
         ..VE4KLM
         +Password :
         .BLAHBLAH
         wl2k
         -------
         i0ojj 0023 P
         # Here we are talking to obcm v1.07b12
         # NOTE : OBCM supports FC proposal, so it will use B2F, but wonder if
         # I should force a B1F response so RLINE and Headers work properly ?
         telnet 44.x.y.z 4719 iac
         @10
         +login:
         .ve4klm
         @10
         +password:
         .BLAHBLAH
         @10
         <areas to forward>
         -------
         ir0aab 0023 P
         # Here we are talking to linfbb v7.0.8-beta2
         telnet 44.x.y.z 6300 iac
         @
         +Callsign :
         .ve4klm
         +Password :
         .BLAHBLAH
         @
         <areas to forward>
         -------

      c) setting up MY winlink authentication

         cd /jnos

         mkdir users		* you only need to do this one time

         ./jnospwmgr -a <callsign> -w

         it will ask you to enter the phrase that you would have received
         from your winlink notice (the challenge/response phrase).         

       * for now please read release notes (search December 8) for more info.

   Remote LINFBB host
   ------------------

     For forwarding to VE4KLM I added the following line to 'bbs.sys' :

       < FWD\VE4KLM

     A forward file for that particular bbs is placed in FBB's 'fwd' directory,
     so an example of forward file, 've4klm' (contents might be different for
     other FBB owners.)

       A VE4KLM

         P A
         C C ve4klm ve4klm.ampr.org 6300
         V login$Wpassword$W

       #  Forward file -- To VE4KLM BBS (JNOS)
       #
       #  Personal mail
       #
       B VE4KLM
       F VE4KLM
       #
       # Reverse fowarding to take place
       R
       # Forward rest of North-America to VE4KLM
       H  VE4KLM.#WPG.MB.CAN.NOAM
       H *.NOAM
       #

   Remote BPQ host
   ---------------

     This is needed as telnet connect script for bpq in forwarding with jnos.
     It is entered in the "connect script" box of the forwarding config web
     page of the bpq mail server.

       TIMES 0000-2359
       Idletime 60
       attach 3
       c ve4klm.ampr.org 23 NEEDLF .login pass

     General:

       attach p - p is a port number cfg'd as telnet port in your bpq32.cfg

       c Hostname TCPport [NEEDLF] User Password [Command]

     Here :

       attached 3 - I configured port 3 as telnet port
       NEEDLF     - Causes a Line Feed to be sent after user and password.
       .login     - The period before the login user name will tell jnos to use
                    a transparent TCP session instead of ordinary telnet.

     See: http://www.cantab.net/users/john.wiseman/Documents/TelnetServer.htm

     This example line below is needed in bpq32.cfg so that jnos can login into
     bpq and initiate forwarding as bbs.
 
       USER=ve4klm,password,login,BBS

   Remote OBCM host
   ----------------

     ; From obcm v1.07b12
     ;
     ; INIT IR0RM file (JNOS-2.0k+)
     ;          0                  1                  2
     ;          012345678901234567890123
     IR0RM PPPPPPPPPPPPPPPPPPPPPPPP TELNET:44.x.y.z:6300
      -d -k -l -o -u
     ;

   Remote LINFBB host
   ------------------

     # From linfbb v7.0.8-beta2
     #
     IF H 00-23
      S connected failure busy
      C C IR0RM-1 44.x.y.z 6300
      V i0ojj$Wpassword$W
     ENDIF
     #

 

F6fbb port.sys (smtp/pop/nntp)

With f6fbb it is possible to use the software as smtp, pop and nntp server. Below is a small example of how you can make that possible.

# /usr/local/etc/ax25/fbb/port.sys
# FBB 7.07
#
#
# Number of Com Ports and TNCs (not) including TNC 0
             2            2
#
# Interface 6 = Windows
# Interface 7 = TCPIP
# Interface 8 = TFWin.dll
# Interface 9 = LINUX
#
#Com Interface Adress (Hex)   Baud
  2    9        189C               0
  3    9        189D:189E:77       0
#TNC NbCh Com MultCh   Pacln Maxfr NbFwd MxBloc M/P-Fwd  Mode  Freq
  0   0    0   0        0     0     0     0      00/01   ----  File-fwd.
  1   10   2   0        250   2     4     10     00/60   TUWY  Telnet
  2   4    3   0        250   2     4     10     00/10   SU    Pop/smtp
#
# End of file.
#

If you look at the HEX addresses, the smpt port on 6302 and the pop port on 6301 the nntp port just on 119. Now it is possible to set your mail program and read your mail in your mail package.

Email address comes with one with your packet address (pd9q@pi8lap.#zl.nld.euro)