3 # Set a variable called stdin to help us
4 # get the variables from Asterisk
7 # Read in the variables from Asterisk,
8 # and write them to a log file
9 while [ "$stdin" != "" ]
12 # if [ "$stdin" != EOF ]
14 # echo $stdin >> /tmp/logfile.txt
18 /bin/uci show "mars" | grep AST_* | sort | while read LINE; do
20 ### VAR=$(echo "$LINE" | sed 's/mars\./mars /; s/\./ /' | awk '{print $3}')
21 ### VAR=$(echo $LINE | cut -f 3 -d '.')
22 POS=$(expr index "$LINE" A)
23 VAR=$(expr substr "$LINE" $POS 100)
25 # Send AGI Cmd to asterisk
26 echo "EXEC SetGlobalVar \"$VAR\""
29 # Now read the response back from Asterisk,
30 ### Reading resp cause problems with first read. just ignore
32 # echo $response >> /tmp/logfile.txt