[arm-allstar] on connect script help

Russell Thomas russell at kv4s.com
Fri Apr 15 14:44:07 EDT 2022


Nevermind this appears to work!
lol i must have messed something up the first time i tried to use it
because the script didn't do anything at first.

ASTDB="/var/log/asterisk/astdb.txt"
CALL=$(awk '-F|' '$1 ~ /^'$2'$/ {print "callsign: "$2}' < $ASTDB)

I just substituted your node variable for $2 which is coming from
conngpm when it calls my bash script originally.


On Fri, Apr 15, 2022 at 12:43 PM Russell Thomas <russell at kv4s.com> wrote:

> Awesome, thanks!
>
> is it possible to use other variables in the awk call?
>
> when congpm calls my msg scrip it's using $1 and $2 to be the node numbers.
>
>
>
> On Fri, Apr 15, 2022 at 11:07 AM David McGough <kb4fxc at inttek.net> wrote:
>
>>
>> Russell,
>>
>> You can pull data from the /var/log/asterisk/astdb.txt file for each node
>> number and use that data to give more info about the nodes.
>>
>> Something to be aware of however, is that the astdb.txt file data
>> "quality" isn't fantastic, since users are allowed to basically enter
>> free-form data on the ASL portal site.  Also, there are even cases where
>> the node Trustee's callsign is missing, which IMO is not good.
>>
>> Here is a simple bash example to extract the callsign column from this
>> file for node 2286:
>>
>> NODE=2286
>>
>> ASTDB="/var/log/asterisk/astdb.txt"
>>
>> CALL=$(awk '-F|' '$1 ~ /^'$NODE'$/ {print "callsign: "$2}' < $ASTDB)
>>
>> echo $CALL
>>
>>
>> 73, David KB4FXC
>>
>>
>> On Wed, 13 Apr 2022, "Russell Thomas via ARM-allstar" wrote:
>>
>> > I've been running this bash script for a few years, and it's functioned
>> > flawlessly.
>> >
>> > echo "Node $2 connected to node $1 at $(date +%Y-%m-%d.%H:%M:%S):" |
>> mail
>> > -s "My repeater" 6165551212 at vtext.com # verizon text message
>> >
>> > Are there variables I can use to get the callsign and/or the node
>> > information to "pretty up" my message?
>> >
>> > 47923 KV4S 432.200 Chelsea, Alabama
>> >
>> > 73,
>> > Russell Thomas, KV4S
>> > _______________________________________________
>> >
>> > ARM-allstar mailing list
>> > ARM-allstar at hamvoip.org
>> > http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>> >
>> > Visit the BBB and RPi2/3/4 web page - http://hamvoip.org
>> >
>>
>>


More information about the ARM-allstar mailing list