Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- function check_directory() {
- [[ -d build ]] && echo "O diretório /build já existe" ||
- echo "Diretório /build criado!" && mkdir build
- }
- function check_git() {
- url=https://github.com/brektrou/rtl8821CU.git
- if [[ $(wget -S --spider $url 2>&1 | grep 'HTTP/1.1 200 OK') ]]; then
- return 0
- else
- return 1
- fi
- }
- function clone_repository() {
- git clone https://github.com/brektrou/rtl8821CU.git
- }
- function compile_and_install() {
- check_directory
- cd build || exit 0
- if check_git; then
- clone_repository
- cd rtl8821CU/ || exit 0
- make && sudo make install
- else
- echo "Falha na operação."
- exit 0
- fi
- }
- function check_driver() {
- comando=$(ls /lib/modules/"$(uname -r)"/kernel/drivers/net/wireless/realtek/rtl8821cu &> /dev/null)
- [[ $comando ]] && echo "Instalado com sucesso!" || echo "Não instalado!"
- }
- check_directory
- compile_and_install
- check_driver
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement