Created
January 1, 2023 16:36
-
-
Save kng/ace49dd664c206434720edb32b35c0e0 to your computer and use it in GitHub Desktop.
Workaround for old flowgraphs with satnogs-client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#SATNOGS_RIG_IP=rigctld | |
CLIENT=satnogs-client | |
RIGIP=$(getent hosts "$SATNOGS_RIG_IP" | awk '{ print $1 }') | |
FLOWGRAPHS=(/usr/bin/satnogs_*.py) | |
OUTPATH=~/.local/bin | |
if [ -z "$RIGIP" ]; then | |
echo "Warning: unable to resolve SATNOGS_RIG_IP" | |
exec $CLIENT | |
fi | |
if grep -q "tcp_rigctl_msg_source(\"127.0.0.1" "$FLOWGRAPHS"; then | |
echo "Updating flowgraphs..." | |
mkdir -p "$OUTPATH" | |
for FG in "${FLOWGRAPHS[@]}"; do | |
F=${FG##*/} | |
echo "$F" | |
sed "s/tcp_rigctl_msg_source(\"127.0.0.1\"/tcp_rigctl_msg_source(\"$RIGIP\"/" "$FG" > "$OUTPATH/$F" | |
chmod 0755 "$OUTPATH/$F" | |
done | |
export PATH=$OUTPATH:$PATH | |
fi | |
echo "Starting $CLIENT" | |
exec $CLIENT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment