Update install.sh
This commit is contained in:
parent
462165c894
commit
a6352ef6f8
30
install.sh
30
install.sh
|
@ -5,6 +5,7 @@
|
||||||
MODNAME="8188eu"
|
MODNAME="8188eu"
|
||||||
DRVNAME="rtl8188eu"
|
DRVNAME="rtl8188eu"
|
||||||
DRVVER="5.13.3"
|
DRVVER="5.13.3"
|
||||||
|
DRVSTATUS="installed"
|
||||||
KVER="$(uname -r)"
|
KVER="$(uname -r)"
|
||||||
MODDESTDIR="/lib/modules/${KVER}/kernel/drivers/net/wireless/"
|
MODDESTDIR="/lib/modules/${KVER}/kernel/drivers/net/wireless/"
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ if ! command -v dkms >/dev/null 2>&1;then
|
||||||
echo "Module ${DRVNAME} already installed"
|
echo "Module ${DRVNAME} already installed"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ ! "`dkms status`" =~ "${DRVNAME}" ]];then
|
if [[ ! "$(echo "`dkms status`" | awk '/'${DRVNAME}'/ {print}')" =~ "${DRVSTATUS}" ]];then
|
||||||
if [ -e /usr/src/${DRVNAME}-${DRVVER} ];then
|
if [ -e /usr/src/${DRVNAME}-${DRVVER} ];then
|
||||||
if [ "$EUID" != "0" ];then
|
if [ "$EUID" != "0" ];then
|
||||||
echo "You need root permissions:"
|
echo "You need root permissions:"
|
||||||
|
@ -67,13 +68,26 @@ else
|
||||||
rm -f ${MODDESTDIR}${MODNAME}.ko
|
rm -f ${MODDESTDIR}${MODNAME}.ko
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$EUID" != "0" ];then
|
if [[ ! -z "$(echo "`dkms status`" | awk '/'${DRVNAME}'/ {print}')" ]];then
|
||||||
echo "You need root permissions:"
|
if [ "$EUID" != "0" ];then
|
||||||
sudo dkms add -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
echo "You need root permissions:"
|
||||||
sudo dkms build -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
sudo dkms remove -m ${DRVNAME} -v ${DRVVER} --all; Error=$?
|
||||||
|
sudo dkms add -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
||||||
|
sudo dkms build -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
||||||
|
else
|
||||||
|
dkms remove -m ${DRVNAME} -v ${DRVVER} --all; Error=$?
|
||||||
|
dkms add -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
||||||
|
dkms build -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
dkms add -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
if [ "$EUID" != "0" ];then
|
||||||
dkms build -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
echo "You need root permissions:"
|
||||||
|
sudo dkms add -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
||||||
|
sudo dkms build -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
||||||
|
else
|
||||||
|
dkms add -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
||||||
|
dkms build -m ${DRVNAME} -v ${DRVVER}; Error=$?
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$Error" != "0" ];then
|
if [ "$Error" != "0" ];then
|
||||||
echo "Install error: $Error"
|
echo "Install error: $Error"
|
||||||
|
@ -105,7 +119,7 @@ if ! command -v dkms >/dev/null 2>&1;then
|
||||||
echo "Module ${DRVNAME} already uninstalled"
|
echo "Module ${DRVNAME} already uninstalled"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ "`dkms status`" =~ "${DRVNAME}" ]];then
|
if [[ "$(echo "`dkms status`" | awk '/'${DRVNAME}'/ {print}')" =~ "${DRVSTATUS}" ]] || [[ ! -z "$(echo "`dkms status`" | awk '/'${DRVNAME}'/ {print}')" ]];then
|
||||||
if [ "$EUID" != "0" ];then
|
if [ "$EUID" != "0" ];then
|
||||||
echo "You need root permissions:"
|
echo "You need root permissions:"
|
||||||
sudo dkms remove -m ${DRVNAME} -v ${DRVVER} --all; Error=$?
|
sudo dkms remove -m ${DRVNAME} -v ${DRVVER} --all; Error=$?
|
||||||
|
|
Loading…
Reference in New Issue