#!/bin/bash # # Script to flip Allstar Nodes, by K0KN 7/2012 # # Usage = astflip [1] [0] 0=normal 1=flipped # # # # Sample DTMF commands for rpt.conf: # 50=cmd,/home/kyle/astflip 0 ; unflip nodes - normal # 51=cmd,/home/kyle/astflip 1 ; flip VHF and UHF nodes # # You also need to create two copies of rpt.conf. One is the normal, unflipped config # and the other is the flipped config. # # Here's a normal node stanza: # # [2211] # rxchannel=SimpleUSB/usb2211 # # and here's a 'flipped' node stanza: # # [2211] # rxchannel=SimpleUSB/usb2212 # CUSTOM=/home/kyle ASTERISK=/etc/asterisk NORMAL=/etc/asterisk/rpt.normal FLIPPED=/etc/asterisk/rpt.flipped BACKUP=/etc/asterisk/rpt.bak if [ "$1" == "" ] ; then echo "Missing Argument(s)" ; exit fi # Flip configs if [ $1 == 1 ] ; then cp "$FLIPPED" "$ASTERISK/rpt.conf" fi if [ $1 == 0 ] ; then cp "$NORMAL" "$ASTERISK/rpt.conf" fi # Restart Asterisk asterisk -rx "restart now" # done exit 0 fi