Guest User

Untitled

a guest
Apr 21st, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. if ! /bin/grep -q '^Revisions*:s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[dD][0-9a-fA-F]$' /proc/cpuinfo ; then
  4. exit 0
  5. fi
  6.  
  7. if /bin/grep -q "^country=[A-Z][A-Z]" /etc/wpa_supplicant/wpa_supplicant.conf; then
  8. exit 0
  9. fi
  10.  
  11. if [ ! -x "/usr/sbin/rfkill" ]; then
  12. echo "rfkill not installed"
  13. exit 1
  14. fi
  15. mkdir -p "/var/lib/systemd/rfkill"
  16.  
  17. address="$(/bin/grep -m 1 /mmc /proc/iomem | /usr/bin/cut -f1 -d-)"
  18. if [ -z "$address" ]; then
  19. echo "Could not determine WiFi iomem address"
  20. exit 1
  21. fi
  22. persist_file="/var/lib/systemd/rfkill/platform-$address.mmc:wlan"
  23.  
  24. /bin/echo 1 > "$persist_file"
  25. /usr/bin/touch /run/wifi-country-unset
  26. /bin/echo "Wi-Fi is disabled because the country is not set"
Add Comment
Please, Sign In to add comment