Created
February 8, 2025 19:28
-
-
Save filipsPL/86b5192ba2b6552ee67455800c421cae to your computer and use it in GitHub Desktop.
Meshtastic cli script to broadcast good news
This file contains hidden or 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 | |
HOST="192.168.1.11" | |
CMD="meshtastic --wait-to-disconnect 5 --host $HOST" | |
get_channel (){ | |
$CMD --info | grep modemPreset | tr -d '[:space:]' | cut -d':' -f 2 | tr -d ',' | xargs | |
} | |
get_channel | |
echo "Przełączamy na LONG_FAST" | |
$CMD --ch-longfast | |
echo "Spimy" | |
sleep 25 | |
channel=$(get_channel) | |
echo $channel | |
if [ "$channel" == "LONG_FAST" ]; then | |
echo "Jesteśmy na $channel - wysyłam wiadomość" | |
$CMD --sendtext 'W lutym https://przejdznamediumfast.pl/' | |
echo "Przełączamy na MEDIUM_FAST" | |
$CMD --ch-medfast | |
echo "Śpimy" | |
sleep 25 | |
get_channel | |
exit 0 | |
else | |
echo "Jesteśmy ciągle na $channel - kończymy" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment