Linux HAM/Amateur Radio development
 help / color / mirror / Atom feed
* AX25 in /etc/init.d
@ 2009-05-01  3:42 C Schuman
  2009-05-01 20:06 ` Patrick Ouellette
  0 siblings, 1 reply; 7+ messages in thread
From: C Schuman @ 2009-05-01  3:42 UTC (permalink / raw)
  To: Linux-Hams

I installed AX.25 on a system a couple of days ago and when I copied my 
usual ax25 script into /etc/init.d/ I received a message saying that the 
script did not have a proper header. The script worked without any 
problem, but it started me thinking.  Most Ax.25 Howto Docs make little 
of the bootup process. Some even suggest that the kissattach and other 
config commands be placed in the rc.local file.

AX.25 is becoming a major work in Linux systems. It deserves to have 
it's own boot script. I have been using the same script for years and I 
recently added the the requested header. I would like to suggest that 
AX.25 How to docs include the use of such a script and have attached my 
script as an example.

73
<<Charley>>
      k4gbb

#! /bin/bash
# Provided by Charles S Schuman ( K4GBB )
# 04/29/09

### BEGIN INIT INFO
# Provides: ax25
# Required-Start: /etc/ax25/ax25-up
# Required-Stop: /etc/ax25/ax25-down
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Ax.25 initialization
# Description: This script provides the control for the ax.25 packet 
radio service.
#           The fine tuneing is accomplished via /etc/ax25/ax25-up and 
/etc/ax25/ax25-down.
#
### END INIT INFO

StartAx25="yes"

# /etc/init.d/ax25
#
# Kernel-Parameter "ax25=yes|no" ?
      if [ "`grep -e [Aa][Xx]25=[Nn][Oo] /proc/cmdline`" != "" ] ; then
        echo -e "ax25: Aborting startup on user request (kernel boot 
parameter)."
        exit 1
      fi

case "$1" in

  start|-start)
    echo "/etc/init.d/ax25: Starting AX25..."
    /etc/ax25/ax25-up
    ;;

    stop|-stop)
    echo "Stopping AX25..."
    /etc/ax25/ax25-down
    ;;

   restart|-restart)
    echo "AX25 Restart"
    /etc/ax25/ax25-down
    sleep 1
    /etc/ax25/ax25-up
    ;;

  status|-status)
    if [ ! -d /proc/sys/net/ax25 ] ; then
      echo "ax25 is down"
    else 
      echo "$(ls /proc/sys/net/ax25)" > /tmp/ax25-config.tmp
      read Select < /tmp/ax25-config.tmp
      i=0
      while [ "$Select" != "" ]
      do
      let i=i+1
      awk ' NR == '$i' { print $1 }' /tmp/ax25-config.tmp > 
/tmp/ax25-config-tmp
      read Select < /tmp/ax25-config-tmp
        if [ "$Select" != "" ]; then
          /sbin/ifconfig "$Select"
        fi
      done
        if [ -z "$(uname -r | grep kjd)" ] ;then
          netstat --ax25
        else
          /sbin/ifconfig ipax0
          cat /proc/net/ax25
        fi 
    fi
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
    ;;
esac

exit 0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-05-01 22:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-01  3:42 AX25 in /etc/init.d C Schuman
2009-05-01 20:06 ` Patrick Ouellette
2009-05-01 20:40   ` C Schuman
2009-05-01 21:47     ` Patrick Ouellette
2009-05-01 22:38       ` Ray Wells
2009-05-01 22:57         ` C Schuman
2009-05-01 22:46       ` C Schuman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox