#! /bin/bash # Provided by Charles S Schuman ( k4gbb1@gmail.com ) # Nov 09/2015 ### BEGIN INIT INFO # Provides: ax25 # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Ax.25 initialization # Description: This script provides the control for the ax.25 Packet Radio Service. # The fine tuning is accomplished via /etc/ax25/ax25-up and /etc/ax25/ax25-down. # ### END INIT INFO # Using the lsb functions to perform the operations. . /lib/lsb/init-functions NAME=Ax25 # Process name ( For display ) DAEMON=/usr/local/etc/ax25/ax25-up PIDFILE=/var/run/ax25.pid # pid file for the daemon test -x $DAEMON || exit 5 # Exit - Pgm Not Installed. # Check the status of ax25 if [ -d /proc/sys/net/ax25/ax0 ]; then echo -e "\t $NAME: is already running." netstat|grep LISTENING exit 1 fi echo -e "\t *** $NAME $1 ***" /etc/ax25/ax25-up ;; stop ) echo " *** $NAME $1 ***" /etc/ax25/ax25-down ;; restart ) echo " *** $NAME $1 ***" /etc/ax25/ax25-down sleep 1 /etc/ax25/ax25-up ;; status ) echo " *** $NAME $1 ***" if [ ! -d /proc/sys/net/ax25/ax0 ] ; then echo "ax25 is down" else if [ -z "$(uname -r | grep kjd)" ] ;then # netstat --ax25 netstat|grep LISTENING else /sbin/ifconfig ipax0 cat /proc/net/ax25 fi fi ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac exit 0