install.sh 727 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. if [ "$(id -u)" != "0" ]; then
  3. echo "This script must be run as root" 1>&2
  4. exit 1
  5. fi
  6. DRIV_DIR=/lib/modules/$(uname -r)/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8812au
  7. make -j$(nproc) &&
  8. mkdir -p $DRIV_DIR &&
  9. xz -c 8812au.ko > $DRIV_DIR/rtl8812au.ko.xz &&
  10. cp 8812au.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless &&
  11. depmod &&
  12. echo "
  13. ***Success***
  14. ***Module will be activated automatically at next reboot***
  15. " &&
  16. while true; do
  17. read -p "Do you wish to activate the module now? (y/n)" yn
  18. case $yn in
  19. [Yy]* ) modprobe rtl8812au && echo "***Module activated***" && break;;
  20. [Nn]* ) exit;;
  21. * ) echo "Please answer yes or no.";;
  22. esac
  23. done