финальный релиз. распространяется под GPLV2/BSD
- код выделить все
#!/bin/sh
iface="ppp0"
loop_delay="1s"yellow_led="off"
white_led="off"gpio enable 2 ; gpio enable 3
while sleep $loop_delay ; do
state=`ifconfig | grep $iface`if [ -z "$state" ] ; then
if [ "$yellow_led" = "off" ] ; then
gpio enable 2 ; gpio disable 3
yellow_led="on"
else
gpio enable 2 ; gpio enable 3
yellow_led="off"
fiwhite_led="off"
else
if [ "$white_led" = "off" ] ; then
gpio enable 3 ; gpio disable 2
yellow_led="off"
white_led="on"
fi
fi
done