Compare commits

...

2 Commits

Author SHA1 Message Date
5f289995ba svc.sh: check if arg 2 is present for up cmd 2021-10-31 21:35:49 -07:00
5542e2ab9a rtlwifi-setup: change drive source 2021-10-27 21:50:51 -07:00
2 changed files with 17 additions and 16 deletions

View File

@@ -1,17 +1,17 @@
#!/bin/bash #!/bin/bash
pkgname="rtlwifi" pkgname="rtl88x2bu-git"
pkgurl="https://github.com/cilynx/rtl88x2bu.git" pkgurl="https://github.com/RinCat/RTL88x2BU-Linux-Driver.git"
tmpdir="/tmp" tmpdir="/usr/src"
_fetch_deps(){ _fetch_deps(){
if [ -f /usr/bin/apt ];then if [ -f /usr/bin/apt ];then
apt install git dnsmasq hostapd bc build-essential dkms wget unzip rsync sudo apt install git dnsmasq hostapd bc build-essential dkms wget unzip rsync
elif [ -f /usr/bin/dnf ];then elif [ -f /usr/bin/dnf ];then
dnf group install "Development Tools" sudo dnf group install "Development Tools"
dnf install unzip dnsmasq hostapd bc dkms kernel-headers rsync wget sudo dnf install unzip dnsmasq hostapd bc dkms kernel-headers rsync wget
else else
echo "No supported package manager" echo "No supported package manager"
fi fi
@@ -20,7 +20,7 @@ _fetch_deps(){
_download(){ _download(){
if [ ! -d "${tmpdir}"/"${pkgname}" ];then if [ ! -d "${tmpdir}"/"${pkgname}" ];then
git clone "${pkgurl}" "${tmpdir}"/"${pkgname}" sudo git clone "${pkgurl}" "${tmpdir}"/"${pkgname}"
fi fi
} }
@@ -30,14 +30,10 @@ _apply_patch(){
} }
_install(){ _install(){
cd "${tmpdir}"/"${pkgname}" || exit 1 sed -i 's/PACKAGE_VERSION="@PKGVER@"/PACKAGE_VERSION="git"/g' /usr/src/rtl88x2bu-git/dkms.conf
#_apply_patch sudo dkms add -m rtl88x2bu -v git
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf) sudo dkms autoinstall
rsync -rvhP ./ /usr/src/rtl88x2bu-"${VER}" sudo modprobe 88x2bu
dkms add -m rtl88x2bu -v "${VER}"
dkms build -m rtl88x2bu -v "${VER}"
dkms install -m rtl88x2bu -v "${VER}"
modprobe 88x2bu
} }
_fetch_deps _fetch_deps

7
svc.sh
View File

@@ -133,7 +133,12 @@ systemd(){
echo echo
;; ;;
up) up)
systemctl --type=service --state=running if [[ ! -z "${2}" ]];then
systemctl status "${2}"
else
systemctl --type=service --state=running
fi
;; ;;
start) start)