mirror of
https://github.com/morrownr/8821cu-20210916.git
synced 2024-11-18 19:44:48 +00:00
misc cleanup
This commit is contained in:
parent
699b46b5dc
commit
ece6b5f483
1
default-editor
Normal file
1
default-editor
Normal file
@ -0,0 +1 @@
|
|||||||
|
nano
|
@ -1,11 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
|
||||||
OPTIONS_FILE="8821cu.conf"
|
|
||||||
SCRIPT_NAME="edit-options.sh"
|
|
||||||
DEFAULT_EDITOR="nano"
|
|
||||||
#
|
|
||||||
# Purpose: Make it easier to edit the driver options file.
|
# Purpose: Make it easier to edit the driver options file.
|
||||||
#
|
#
|
||||||
|
# Flexible editor support.
|
||||||
|
#
|
||||||
# To make this file executable:
|
# To make this file executable:
|
||||||
#
|
#
|
||||||
# $ chmod +x edit-options.sh
|
# $ chmod +x edit-options.sh
|
||||||
@ -14,6 +12,22 @@ DEFAULT_EDITOR="nano"
|
|||||||
#
|
#
|
||||||
# $ sudo ./edit-options.sh
|
# $ sudo ./edit-options.sh
|
||||||
#
|
#
|
||||||
|
# Copyright(c) 2023 Nick Morrow
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of version 2 of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
SCRIPT_NAME="edit-options.sh"
|
||||||
|
SCRIPT_VERSION="20230120"
|
||||||
|
OPTIONS_FILE="8821cu.conf"
|
||||||
|
DEFAULT_EDITOR=`cat default-editor`
|
||||||
|
|
||||||
if [[ $EUID -ne 0 ]]
|
if [[ $EUID -ne 0 ]]
|
||||||
then
|
then
|
||||||
echo "You must run this script with superuser (root) privileges."
|
echo "You must run this script with superuser (root) privileges."
|
||||||
@ -33,8 +47,8 @@ then
|
|||||||
TEXT_EDITOR="${DEFAULT_EDITOR}"
|
TEXT_EDITOR="${DEFAULT_EDITOR}"
|
||||||
else
|
else
|
||||||
echo "No text editor found (default: ${DEFAULT_EDITOR})."
|
echo "No text editor found (default: ${DEFAULT_EDITOR})."
|
||||||
echo "Please install one and set the VISUAL or EDITOR variables to point to it."
|
echo "Please install ${DEFAULT_EDITOR} or edit the file 'default-editor' to specify your editor."
|
||||||
echo "When you have an editor, please run \"sudo ./${SCRIPT_NAME}\""
|
echo "Once complete, please run \"sudo ./${SCRIPT_NAME}\""
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -3,7 +3,15 @@
|
|||||||
# Purpose: Install Realtek out-of-kernel USB WiFi adapter drivers.
|
# Purpose: Install Realtek out-of-kernel USB WiFi adapter drivers.
|
||||||
#
|
#
|
||||||
# Supports dkms and non-dkms installations.
|
# Supports dkms and non-dkms installations.
|
||||||
|
#
|
||||||
|
# To make this file executable:
|
||||||
|
#
|
||||||
|
# $ chmod +x edit-options.sh
|
||||||
|
#
|
||||||
|
# To execute this file:
|
||||||
|
#
|
||||||
|
# $ sudo ./edit-options.sh
|
||||||
|
#
|
||||||
# Copyright(c) 2023 Nick Morrow
|
# Copyright(c) 2023 Nick Morrow
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
@ -16,10 +24,9 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
SCRIPT_NAME="install-driver.sh"
|
SCRIPT_NAME="install-driver.sh"
|
||||||
SCRIPT_VERSION="20230116"
|
SCRIPT_VERSION="20230121"
|
||||||
MODULE_NAME="8821cu"
|
MODULE_NAME="8821cu"
|
||||||
DRV_VERSION="5.12.0.4"
|
DRV_VERSION="5.12.0.4"
|
||||||
DEFAULT_EDITOR="nano"
|
|
||||||
|
|
||||||
KVER="$(uname -r)"
|
KVER="$(uname -r)"
|
||||||
KARCH="$(uname -m)"
|
KARCH="$(uname -m)"
|
||||||
@ -31,6 +38,7 @@ OPTIONS_FILE="${MODULE_NAME}.conf"
|
|||||||
|
|
||||||
SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }')
|
SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }')
|
||||||
sproc=$(nproc)
|
sproc=$(nproc)
|
||||||
|
DEFAULT_EDITOR=`cat default-editor`
|
||||||
|
|
||||||
# check to ensure sudo was used
|
# check to ensure sudo was used
|
||||||
if [[ $EUID -ne 0 ]]
|
if [[ $EUID -ne 0 ]]
|
||||||
@ -66,8 +74,8 @@ fi
|
|||||||
# check to see if header files are installed
|
# check to see if header files are installed
|
||||||
if [ ! -d "/lib/modules/$(uname -r)/build" ]; then
|
if [ ! -d "/lib/modules/$(uname -r)/build" ]; then
|
||||||
echo "Your kernel header files aren't properly installed."
|
echo "Your kernel header files aren't properly installed."
|
||||||
echo "Please consult your distro documentation."
|
echo "Please consult your distro documentation or user support forums."
|
||||||
echo "Once the header files are installed, please run \"sudo ./${SCRIPT_NAME}\""
|
echo "Once the header files are properly installed, please run \"sudo ./${SCRIPT_NAME}\""
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -101,8 +109,8 @@ then
|
|||||||
TEXT_EDITOR="${DEFAULT_EDITOR}"
|
TEXT_EDITOR="${DEFAULT_EDITOR}"
|
||||||
else
|
else
|
||||||
echo "No text editor found (default: ${DEFAULT_EDITOR})."
|
echo "No text editor found (default: ${DEFAULT_EDITOR})."
|
||||||
echo "Please install one and set the VISUAL or EDITOR variables to point to it."
|
echo "Please install ${DEFAULT_EDITOR} or edit the file 'default-editor' to specify your editor."
|
||||||
echo "When you have an editor, please run \"sudo ./${SCRIPT_NAME}\""
|
echo "Once complete, please run \"sudo ./${SCRIPT_NAME}\""
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -146,7 +154,7 @@ then
|
|||||||
sproc=2
|
sproc=2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# display total number of cpu cores / in use
|
# display total number of in-use cpu processes / total cpu processes
|
||||||
echo ": ${sproc}/$(nproc) (sproc/nproc)"
|
echo ": ${sproc}/$(nproc) (sproc/nproc)"
|
||||||
|
|
||||||
# display kernel version
|
# display kernel version
|
||||||
|
@ -3,7 +3,15 @@
|
|||||||
# Purpose: Remove Realtek out-of-kernel USB WiFi adapter drivers.
|
# Purpose: Remove Realtek out-of-kernel USB WiFi adapter drivers.
|
||||||
#
|
#
|
||||||
# Supports dkms and non-dkms removals.
|
# Supports dkms and non-dkms removals.
|
||||||
|
#
|
||||||
|
# To make this file executable:
|
||||||
|
#
|
||||||
|
# $ chmod +x edit-options.sh
|
||||||
|
#
|
||||||
|
# To execute this file:
|
||||||
|
#
|
||||||
|
# $ sudo ./edit-options.sh
|
||||||
|
#
|
||||||
# Copyright(c) 2023 Nick Morrow
|
# Copyright(c) 2023 Nick Morrow
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
@ -22,7 +30,6 @@ DRV_VERSION="5.12.0.4"
|
|||||||
|
|
||||||
KVER="$(uname -r)"
|
KVER="$(uname -r)"
|
||||||
KARCH="$(uname -m)"
|
KARCH="$(uname -m)"
|
||||||
#KSRC="/lib/modules/${KVER}/build"
|
|
||||||
MODDESTDIR="/lib/modules/${KVER}/kernel/drivers/net/wireless/"
|
MODDESTDIR="/lib/modules/${KVER}/kernel/drivers/net/wireless/"
|
||||||
|
|
||||||
DRV_NAME="rtl${MODULE_NAME}"
|
DRV_NAME="rtl${MODULE_NAME}"
|
||||||
|
Loading…
Reference in New Issue
Block a user