Guest User

Untitled

a guest
Jul 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. SW1=$(cat /sys/class/gpio/gpio18/value)
  4. SW2=$(cat /sys/class/gpio/gpio20/value)
  5. case $SW1$SW2 in
  6. "10")
  7. logger -t mr3020 "W trybie 3G"
  8. ;;
  9. "01")
  10. uci set network.lan.ifname=eth0
  11. uci set network.wan.ifname=wlan0
  12. uci commit network
  13. uci set wireless.@wifi-iface[0].network=wan
  14. uci set wireless.@wifi-iface[0].mode=sta
  15. uci set wireless.@wifi-iface[0].ssid=Oki
  16. uci set wireless.@wifi-iface[0].encryption=psk2
  17. uci set wireless.@wifi-iface[0].key=osiemosiep
  18. uci commit wireless
  19. /etc/init.d/network restart
  20. logger -t mr3020 "W trybie WISP"
  21. ;;
  22. "11")
  23. uci set network.lan.ifname=wlan0
  24. uci set network.wan.ifname=eth0
  25. uci commit network
  26. uci set wireless.@wifi-iface[0].network=lan
  27. uci set wireless.@wifi-iface[0].mode=ap
  28. uci set wireless.@wifi-iface[0].ssid=AP 2B
  29. uci del wireless.@wifi-iface[0].encryption
  30. uci del wireless.@wifi-iface[0].key
  31. uci commit wireless
  32. /etc/init.d/network restart
  33. logger -t mr3020 "W trybie AP"
  34. ;;
  35. esac
Add Comment
Please, Sign In to add comment