mirror of
https://github.com/AG7GN/nexus-utilities.git
synced 2025-05-20 00:10:11 -07:00
Added ability to capture Direwolf output via socat
This commit is contained in:
parent
1e54c2529d
commit
c8035d5560
@ -11,6 +11,13 @@ This script allows you to run Direwolf as an APRS digipeater (full or fill-in) a
|
||||
<p>
|
||||
See Direwolf author WB2OSZ's <a href="https://github.com/wb2osz/direwolf/blob/master/doc/Successful-APRS-IGate-Operation.pdf">Successful APRS IGate Operation</a> for some good tips on using APRS.
|
||||
</p>
|
||||
<p>
|
||||
Note that you can use the output text (everything that appears in the Monitor window) in your own script by incorporating this command into your script:
|
||||
</p>
|
||||
<pre>socat udp-recv:3333,reuseaddr -</pre>
|
||||
<p>
|
||||
That command will monitor UDP port 3333, the port to which the main script writes its data, to STDOUT so you can capture the data and manipulate it as needed.
|
||||
</p>
|
||||
|
||||
<a href="#monitor">Open monitor window when [re]starting this script</a><br />
|
||||
<a href="#call">Call sign and SSID</a><br />
|
||||
|
@ -16,7 +16,7 @@
|
||||
#%
|
||||
#================================================================
|
||||
#- IMPLEMENTATION
|
||||
#- version ${SCRIPT_NAME} 2.1.2
|
||||
#- version ${SCRIPT_NAME} 2.1.3
|
||||
#- author Steve Magnuson, AG7GN
|
||||
#- license CC-BY-SA Creative Commons License
|
||||
#- script_id 0
|
||||
@ -616,8 +616,8 @@ do
|
||||
if [[ ${F[_MONITOR_]} == "TRUE" ]]
|
||||
then
|
||||
MONITOR_TITLE="APRS $MODE_MESSAGE Monitor"
|
||||
lxterminal --geometry=80x30 -t "$MONITOR_TITLE" -e "socat udp-recv:$SOCAT_PORT -" &
|
||||
echo -e "" | socat - udp-datagram:localhost:$SOCAT_PORT
|
||||
lxterminal --geometry=80x30 -t "$MONITOR_TITLE" -e "socat udp-recv:$SOCAT_PORT,reuseaddr -" &
|
||||
echo -e "" | socat - udp-sendto:127.255.255.255:$SOCAT_PORT,broadcast
|
||||
# Set background color of lxterminal if necessary
|
||||
#if [[ ${F[_COLORS_]} == 0 ]]
|
||||
#then
|
||||
@ -627,9 +627,9 @@ do
|
||||
#fi
|
||||
fi
|
||||
# Send direwolf output to the terminal we opened earlier
|
||||
($DIREWOLF -t ${F[_COLORS_]} -c $DW_CONFIG 2>&6 | socat - udp-datagram:localhost:$SOCAT_PORT) &
|
||||
($DIREWOLF -t ${F[_COLORS_]} -c $DW_CONFIG 2>&6 | socat - udp-sendto:127.255.255.255:$SOCAT_PORT,broadcast) &
|
||||
direwolf_PID=$(pgrep -f "^$DIREWOLF -t ${F[_COLORS_]} -c $DW_CONFIG")
|
||||
socat_PID=$(pgrep -f "socat udp-recv:$SOCAT_PORT -")
|
||||
socat_PID=$(pgrep -f "socat udp-recv:$SOCAT_PORT,reuseaddr -")
|
||||
if [[ $direwolf_PID == "" ]]
|
||||
then
|
||||
echo -e "\nDirewolf was *NOT* started" >&6
|
||||
|
Loading…
x
Reference in New Issue
Block a user