#!/bin/bash # # astban # # Script to disallow Asterisk nodes, by K0KN 2/2013 # # Node numbers in ban list below will have their entry in the local nodelist changed # to prevent incoming or outgoing connections after each update # # This file is intended to be ran by /etc/rc.d/rc.updatenodelist. Place path/filename # on line 43 as shown below. Make sure to killall rc.updatenodelist and then # /etc/rc.d/rc.updatenodelist & # # $CHMOD 700 /tmp/rpt_extnodes-temp # $CP /tmp/rpt_extnodes-temp $FILEPATH/rpt_extnodes-temp # $MV -f $FILEPATH/rpt_extnodes-temp $FILEPATH/rpt_extnodes # /home/kyle/astban # else # # Add banned nodes to the BANLIST file, one per line as such: (without the #) # 2000=radio@ # 2001=radio@ BANLIST=/home/kyle/banlist NODELIST=/var/lib/asterisk/rpt_extnodes if ! [ -f $BANLIST ] ; then touch $BANLIST fi while IFS= read -r line do echo "Banned node: $line" sed -i "s/$line/0$line/g" $NODELIST done < $BANLIST # done exit 0 fi