**Mobile DstarRepeater [#h14396ad] HOMEにircDDBGatewayを置き、屋外でDstarRepeaterのみで運用するためのircDDBGateway側の設定。 +GIP変動に対応 Mobile回線でGIPが変化しても、ircDDBGatewayを追従させるスクリプト ---- ipget.sh ---- #!/bin/bash while : do if [ ! -e /root/rpt_gip.txt ]; then echo "192.168.xxx.yyy" > /root/rpt_gip.txt #何でもよいが、localnet内で使う場合のIPにしておくとよい。 fi NDT=`tcpdump -i eth0 -nAs0 udp port 20014 -c1` #Gateway portに20014を使用する場合 FL1=`echo "$NDT" | grep -e "20014 >"` if test "$FL1" != ""; then OGIP=`tail -1 /root/rpt_gip.txt` NGIP=`echo $NDT | cut -d" " -f3 | cut -d"." -f1-4` echo "GIP of Repeater = $NGIP" if test "$OGIP" != "$NGIP"; then echo "$NGIP" >> /root/rpt_gip.txt PIRC=`pgrep -f ircddbgatewayd` kill -9 $PIRC sleep 2 /bin/sed -e "s/repeaterAddress4=.*$/repeaterAddress4=$NGIP/" /etc/ircddbgateway > /etc/irc_new.txt mv -f /etc/ircddbgateway /etc/ircddbgateway.bak mv /etc/irc_new.txt /etc/ircddbgateway /usr/local/bin/ircddbgatewayd & fi fi sleep 23 pkill tcpdump done &color(Red){''以下作成中''}; #clear #comment #navi(日記) |