Подключение дисплея к Raspberry Pi через сдвиговый регистр 74HC595 http://blindage.org/?p=4835
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

41 lines
748 B

  1. #!/bin/bash
  2. LCDPROG="/opt/lcd/lcd595out /opt/lcd/set2.map"
  3. #detect GW IP address
  4. GATEWAY=`ip r|grep default|awk '{ print $3 }'`
  5. GWPING=`/usr/bin/fping $GATEWAY|grep alive`
  6. online_gw="+GW"
  7. if [ "$GWPING" = "" ]
  8. then
  9. online_gw="-GW"
  10. fi
  11. #check city network
  12. GWPING=`/usr/bin/fping blindage.org|grep alive`
  13. online_tsk="+TSK"
  14. if [ "$GWPING" = "" ]
  15. then
  16. online_tsk="-TSK"
  17. fi
  18. #check internet access
  19. GWPING=`/usr/bin/fping ya.ru|grep alive`
  20. online_int="+INT"
  21. if [ "$GWPING" = "" ]
  22. then
  23. online_int="-INT"
  24. fi
  25. #check openvpn tunnel
  26. GWPING=`/usr/bin/fping 10.0.0.10|grep alive`
  27. online_t="+T"
  28. if [ "$GWPING" = "" ]
  29. then
  30. online_t="-T"
  31. fi
  32. LINES=`echo -e "\x08 Network status\n$online_gw $online_tsk $online_int $online_t"`
  33. $LCDPROG "$LINES"