mirror of
https://github.com/edu4rdshl/linuxscripts.git
synced 2026-07-18 07:34:45 +00:00
Add upnet script.
This commit is contained in:
parent
f891de69dc
commit
d4db6a112f
1 changed files with 20 additions and 0 deletions
20
system-bin/upnet
Executable file
20
system-bin/upnet
Executable file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
# Workaround for RT8822BE wireless cards wifi issue when using the new rtwpci driver.
|
||||||
|
|
||||||
|
if [[ "$UID" -ne 0 ]]; then
|
||||||
|
echo "You need to run the script as root."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Change the ASPM mode using the Link Control Register according to https://wireless.wiki.kernel.org/en/users/documentation/aspm#enabling_aspm_with_setpci (requires pciutils)
|
||||||
|
if command -v setpci >/dev/null; then
|
||||||
|
if setpci -s 00:1c.5 0x50.B=0x40 && modprobe rtwpci; then
|
||||||
|
# Uncomment the next line and change it to match your network services and init in use.
|
||||||
|
systemctl restart iwd systemd-networkd systemd-resolved
|
||||||
|
echo "ASPM configurations applied. Restart your network services if you haven't set them in the script."
|
||||||
|
else
|
||||||
|
echo "An unknown error has occurred. Reboot and try again."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "You need to have pciutils installed in your system."
|
||||||
|
fi
|
||||||
Loading…
Add table
Add a link
Reference in a new issue