This script is used as an LED driver to show the operational status of the ircddbgateway & dstarrepeater daemons. If the daemons are up and running, an LED will be lit from the assigned GPIO to show simple operational status. Permission is granted to freely use and distribute for all purposes.
#!/bin/bashgateway() {
G1=`ps -ef | grep [i]rcddbgate | wc -l`
echo $G1 > /sys/class/gpio/gpio17/value
}repeater() {
R1=`ps -ef | grep [d]star | wc -l`
echo $R1 > /sys/class/gpio/gpio25/value
}for (( ; ; ))
do
gateway && repeater
sleep 10
done
For added fun, you might also want to light an LED to indicate viable connectivity to the internet so that you know if you can connect to a reflector or not:
#!/bin/bashnetcheck() {
N1=`ping -c 1 8.8.8.8 | grep '1 received' | wc -l`
echo $N1 > /sys/class/gpio/gpio27/value
}for (( ; ; ))
do
netcheck
sleep 20
done