Update RMSGateway 2.5.0.0

Finally i found some time to update the RMSGateway to RMS 2.5.0.0 with Winlink V5 CMS Web Services support. I only found the issue that if have to edit the sysop.xml and add the password. I dont have read that anywhere.

Thanks to /Basil n7nix we are good to go again.

More then 50 People of the 72 needs to update there software.

[email protected]:/home/pd9q/rmsgw/admin# ./versionlist.sh
Using existing version file, with refresh interval: 10 hours

Below rev: 50, Current: 22, Total: 72 at Nov 13 08:23:24 CET 2018
RMS GW Version file is: 0 hours 0 minute(s), 46 seconds old
[email protected]:/home/pd9q/rmsgw/admin#

[email protected]:/home/pd9q# git clone https://github.com/nwdigitalradio/rmsgw
Cloning into 'rmsgw'...
remote: Enumerating objects: 272, done.
remote: Counting objects: 100% (272/272), done.
remote: Compressing objects: 100% (162/162), done.
remote: Total 530 (delta 194), reused 186 (delta 110), pack-reused 258
Receiving objects: 100% (530/530), 406.70 KiB | 0 bytes/s, done.
Resolving deltas: 100% (310/310), done.
Checking connectivity... done.

[email protected]:/home/pd9q# cd rmsgw/admin
[email protected]:/home/pd9q/rmsgw/admin# ./admin-update.sh
Update to V5 Winlink Web Service API
Found file: /etc/rmsgw/sysop.xml
Adding password to /etc/rmsgw/sysop.xml
RMS Gateway files & scripts update completed.

[email protected]:/home/pd9q/rmsgw/admin# ./testwlapi.sh
Directory /root/tmp does not exist ... creating
Starting test at Tue Nov 13 05:21:59 CET 2018 ...
test finished at Tue Nov 13 05:22:14 CET 2018 ...

[email protected]:/home/pd9q/rmsgw/admin# grep -i error /root/tmp/debuglog.txt
Nov 13 05:19:01 gw rmsgw_aci[32448]: Channel Stats: 2 read, 2 active, 0 down, 0 updated, 0 errors
[email protected]:/home/pd9q/rmsgw/admin#

RmsGateway Install and Update script

C. Schuman wrote a script to install and update RMS Gateway. It`s very handy now the are very busy with updating the code of RMS Gateway to handle the new demands of Winlink.

You just have to pay attention to these lines of code that you have the right version.

cd /usr/local/src/ax25
#wget -qt 3 http://k4gbb.us/docs/scripts/rmsgw-2.4.0-181.tgz || /
wget -qt 3 http://k4gbb.no-ip.info/docs/scripts/rmsgw-2.4.0-181.1.tar.bz2
#wget -qt 3 http://www.w3sg.org/RMSGW/download/rmsgw-2.4.0-181.tgz
tar xf rmsgw-2.4.0-181.1.tar.bz2

The version rmsgw-2.4.0-181.1.tar.bz2 is of 14-Sep-2018 16:41

#!/bin/bash
# Installs/Updates the Linux RMS Gateway
# Provided by C Schuman, K4GBB k4gbb1gmail.com
#	Updated 30 Oct 2014

# Color Codes
Reset='\e[0m'
Red='\e[31m'
Green='\e[32m'
Yellow='\e[33m'
Blue='\e[34m'
White='\e[37m'
BluW='\e[37;44m'

UDATE="NO"
GWOWNER="rmsgw"

# Check  User ID

    if [ $UID != 0 ]; then
	echo "You must be root User to perform installation!"
	exit 1
    fi

echo -e "${BluW}\n \t  Install/Update Linux RMS Gate \n${Yellow}\t     version 2.4.0-181  \t \n \t \n${White}  Script provided by Charles S. Schuman ( K4GBB )  \n${Red}               [email protected] \n${Reset}"

echo -e "${BluW}\t Installing Support libraries \t${Reset}"
apt-get install xutils-dev libxml2 libxml2-dev python-requests -y -q
apt-get install build-essential libax25-dev libx11-dev zlib1g-dev libncurses5-dev -y -q

#  create the group for the gateway if it doesn't exist
    grep "rmsgw:" /etc/group >/dev/null 2>&1
    if [ $? -ne 0 ]; then
	echo "Creating group rmsgw..."
	groupadd rmsgw
    fi

#  create the gateway user if it doesn't exist and lock the account

    grep "rmsgw:" /etc/passwd >/dev/null 2>&1
    if [ $? -ne 0 ]; then
	#
	# create the account
	#
 	echo "Creating user rmsgw..."
 	useradd -s /bin/false -g rmsgw rmsgw
    fi

  # lock the account to prevent a potential hole, unless the
  # owner is root
    if [ "$GWOWNER" != root ]; then
	echo "Locking user account $GWOWNER..."
	passwd -l $GWOWNER >/dev/null
	# while the account is locked, make the password to
	# never expire so that cron will be happy
	chage -E-1 $GWOWNER >/dev/null
    fi

echo -e "${BluW}\t Downloading RMS Source file \t${Reset}"

cd /usr/local/src/ax25
#wget -qt 3 http://k4gbb.us/docs/scripts/rmsgw-2.4.0-181.tgz || /
wget -qt 3 http://k4gbb.no-ip.info/docs/scripts/rmsgw-2.4.0-181.1.tar.bz2
#wget -qt 3 http://www.w3sg.org/RMSGW/download/rmsgw-2.4.0-181.tgz
tar xf rmsgw-2.4.0-181.1.tar.bz2
if [ $? -ne 0 ]
   then
 echo -e "${BluW}${Red}\t RMS File not available \t${Reset}"
 exit 1
fi

echo -e "${BluW}\t Compiling RMS Source file \t${Reset}"
cd rmsgw-2.4.0-181.1
make > RMS.txt

if [ $? -ne 0 ]
   then
 echo -e "${BluW}$Red} \tCompile error${White} - check RMS.txt File \t${Reset}"
 exit 1
   else 
 rm RMS.txt
fi
make install
echo -e "${BluW}RMS Gate Installed \t${Reset}"

# Add RMS_ACI to Crontab
cat /etc/crontab|grep rmsgw || echo "#6,36 *  * * *   rmsgw    /usr/local/bin/rmsgw_aci > /dev/null 2>&1
# (End) " >> /etc/crontab

# Install Logging
if [ ! -f "/etc/rsyslog.d/60-rmsgw.conf" ]; then
echo "# RMS Gate" > /etc/rsyslog.d/60-rms.conf 
echo "        local0.info                     /var/log/rms" >> /etc/rsyslog.d/60-rms.conf 
echo "        local0.debug                    /var/log/rms.debug" >> /etc/rsyslog.d/60-rms.conf
echo "        #local0.debug                   /dev/null" >> /etc/rsyslog.d/60-rms.conf 
echo "
# (End)" >> /etc/rsyslog.d/60-rms.conf 

service restart rsyslog
fi

# Use old rmschanstat file.
if [ -f /usr/local/bin/rmschanstat.~1~ ] ; then
    cp /usr/local/bin/rmschanstat.~1~ /usr/local/bin/rmschanstat
fi

date >> /root/Changes
echo "        RMS Gate Installed - rmsgw-2.4.0-181" >> /root/Changes
echo -e "${BluW} Be Sure to Update/Edit the channels.xml and gateway.config file${Reset}"
exit 0
# (End of Script)