From 8caed5ec2d6af34752ea80a29b5c5dc0cd2744a3 Mon Sep 17 00:00:00 2001 From: Kim - DG9VH Date: Mon, 27 Jun 2016 23:01:36 +0200 Subject: [PATCH 1/4] added new reflector ysf.dvbrazil.com.br 42000 --- YSFGateway/YSFHosts.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/YSFGateway/YSFHosts.txt b/YSFGateway/YSFHosts.txt index f65ca1e..d6473f5 100644 --- a/YSFGateway/YSFHosts.txt +++ b/YSFGateway/YSFHosts.txt @@ -26,4 +26,5 @@ ed7zaj.ddns.net 42000 ysf262.ysfreflector.de 42000 ysf444.pa3dfn.nl 42000 vkfusion2.ysfreflector.net 42000 +ysf.dvbrazil.com.br 42000 xrf906.radioclubveleta.es 42000 From 1024443840a46ac589c02c3bcad1bbc5b030c544 Mon Sep 17 00:00:00 2001 From: Kim - DG9VH Date: Tue, 28 Jun 2016 16:17:58 +0200 Subject: [PATCH 2/4] added new reflector --- YSFGateway/YSFHosts.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/YSFGateway/YSFHosts.txt b/YSFGateway/YSFHosts.txt index d6473f5..2eb8118 100644 --- a/YSFGateway/YSFHosts.txt +++ b/YSFGateway/YSFHosts.txt @@ -23,6 +23,7 @@ ysf-fon.f1tzo.com 42000 xrf003.iw0red.it 42000 ed7zaj.ddns.net 42000 194.116.29.78 42000 +xrf003.iw0red.it 42000 ysf262.ysfreflector.de 42000 ysf444.pa3dfn.nl 42000 vkfusion2.ysfreflector.net 42000 From 04285cc9c4f33565999c2eb512bce0f849828c3e Mon Sep 17 00:00:00 2001 From: kc2vrj Date: Tue, 28 Jun 2016 13:32:40 -0400 Subject: [PATCH 3/4] Create YSFHostsupdate.sh --- YSFGateway/YSFHostsupdate.sh | 102 +++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 YSFGateway/YSFHostsupdate.sh diff --git a/YSFGateway/YSFHostsupdate.sh b/YSFGateway/YSFHostsupdate.sh new file mode 100644 index 0000000..4341ad4 --- /dev/null +++ b/YSFGateway/YSFHostsupdate.sh @@ -0,0 +1,102 @@ +#! /bin/bash + +############################################################################### +# +# YSFHostsupdate.sh +# +# Copyright (C) 2016 by Tony Corbett G0WFV +# Adapted to YSFHosts by Paul Nannery KC2VRJ on 6/28/2016 with all crdeit +#TO G0VFV for the orignal script. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +############################################################################### +# +# On a Linux based system, such as a Raspberry Pi, this script will perform all +# the steps required to maintain the YSFHosts.txt (or similar) file for you. +# +# It is designed to run from crontab and will download the YSFHosts from the +# master ysfreflector.de database and optionally keep a backup of previously +# created files for you. +# +# It will also prune the number of backup files according to a value specified +# by you in the configuration below. +# +# When done, it will restart YSFGateway to make the Hosts changes take effect. +# +# To install in root's crontab use the command ... +# +# sudo crontab -e +# +# ... and add the following line to the bottom of the file ... +# +# 0 0 * * * /path/to/script/DMRIDUpdate.sh 1>/dev/null 2>&1 +# +# ... where /path/to/script/ should be replaced by the path to this script. +# +############################################################################### +# +# CONFIGURATION +# +# Full path to YSFHosts +YSFHOSTS=/home/pi/YSFHosts1.txt + +# How many DMR ID files do you want backed up (0 = do not keep backups) +DMRFILEBACKUP=1 +# How many YSFHosts files do you want backed up (0 = do not keep backups) +YSFHOSTSFILEBACKUP=1 + +# Command line to restart YSFGatway +YSFRESTARTCOMMAND="systemctl restart ysfgateway.service" +# YSFRESTARTCOMMAND="killall YSFGateway ; /path/to/YSFGateway/executable/YSFGateway /path/toYSFGateway/ini/file/YSFGateway.ini" + +############################################################################### +# +# Do not edit below here +# +############################################################################### + +# Check we are root +if [ "$(id -u)" != "0" ] +then + echo "This script must be run as root" 1>&2 + exit 1 +fi + +# Create backup of old file +if [ ${YSFHOSTSFILEBACKUP} -ne 0 ] +then + cp ${YSFHOSTS} ${YSFHOSTS}.$(date +%d%m%y) +fi + +# Prune backups +BACKUPCOUNT=$(ls ${YSFHOSTS}.* | wc -l) +BACKUPSTODELETE=$(expr ${BACKUPCOUNT} - ${YSFHOSTSFILEBACKUP}) + +if [ ${BACKUPCOUNT} -gt ${YSFHOSTSFILEBACKUP} ] +then + for f in $(ls -tr ${YSFHOSTS}.* | head -${BACKUPSTODELETE}) + do + rm $f + done +fi + +# Generate YSFHosts.txt file +curl https://register.ysfreflector.de/export.php > ${YSFHOSTS} + +# Restart YSFgateway +eval ${YSFRESTARTCOMMAND} + +exit 0 From 7ca22065f5851d78d37657e68bee2ace5b4d9539 Mon Sep 17 00:00:00 2001 From: kc2vrj Date: Tue, 28 Jun 2016 13:36:39 -0400 Subject: [PATCH 4/4] Added YSFHostsupdate.sh Script to download YSFHosts.txt can be automated with crontab. --- YSFGateway/YSFHostsupdate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/YSFGateway/YSFHostsupdate.sh b/YSFGateway/YSFHostsupdate.sh index 4341ad4..2f8b310 100644 --- a/YSFGateway/YSFHostsupdate.sh +++ b/YSFGateway/YSFHostsupdate.sh @@ -24,7 +24,7 @@ # ############################################################################### # -# On a Linux based system, such as a Raspberry Pi, this script will perform all +# On a Linux based system, such as a Raspberry Pi, this script will perform all # the steps required to maintain the YSFHosts.txt (or similar) file for you. # # It is designed to run from crontab and will download the YSFHosts from the