Update 'GauntPlexNvidia.sh'
This commit is contained in:
@@ -5,18 +5,26 @@ FILENAME="NVIDIA-Linux-x86_64-${VERSION}.run"
|
|||||||
URL="https://us.download.nvidia.com/XFree86/Linux-x86_64/${VERSION}/${FILENAME}"
|
URL="https://us.download.nvidia.com/XFree86/Linux-x86_64/${VERSION}/${FILENAME}"
|
||||||
DRIVER_LOCATION="/opt/nvidia/${FILENAME}"
|
DRIVER_LOCATION="/opt/nvidia/${FILENAME}"
|
||||||
PATCH_LOCATION="${DOWNLOAD_PATH}/nvidia-patch/patch.sh"
|
PATCH_LOCATION="${DOWNLOAD_PATH}/nvidia-patch/patch.sh"
|
||||||
|
NVIDIA_SMI_LOCATION="/bin/nvidia-smi"
|
||||||
|
|
||||||
# i want to see if we can see the version with nvidia-smi with awk and compare so we aren't installing every reboot and only when needed
|
if [ -e "${NVIDIA_SMI_LOCATION}" ]; then
|
||||||
|
INSTALLED_VERSION=$(${NVIDIA_SMI_LOCATION} | awk '/Driver Version/ {print $6}')
|
||||||
# Check and install the nvidia driver
|
else
|
||||||
if [ ! -f "${DRIVER_LOCATION}"]; then
|
INSTALLED_VERSION="000.000.000"
|
||||||
# download as file is misisng
|
fi
|
||||||
wget -P $(dirname ${DRIVER_LOCATION}) ${URL}
|
|
||||||
|
# get installed version if installed and compare to version listed above
|
||||||
|
if [ "${VERSION}" != "${INSTALLED_VERSION}" ]; then
|
||||||
|
# Check and install the nvidia driver
|
||||||
|
if [ ! -f "${DRIVER_LOCATION}" ]; then
|
||||||
|
# download as file is misisng
|
||||||
|
wget -P $(dirname ${DRIVER_LOCATION}) ${URL}
|
||||||
|
fi
|
||||||
|
# ensure the driver can run
|
||||||
|
chmod +x ${DRIVER_LOCATION}
|
||||||
|
# install the driver silently
|
||||||
|
${DRIVER_LOCATION} -s
|
||||||
fi
|
fi
|
||||||
# ensure the driver can run
|
|
||||||
chmod +x ${DRIVER_LOCATION}
|
|
||||||
# install the driver silently
|
|
||||||
${DRIVER_LOCATION} -s
|
|
||||||
|
|
||||||
# After install Patch the driver
|
# After install Patch the driver
|
||||||
cd $(dirname ${PATCH_LOCATION})
|
cd $(dirname ${PATCH_LOCATION})
|
||||||
@@ -25,4 +33,5 @@ git pull
|
|||||||
# ensure patch can run
|
# ensure patch can run
|
||||||
chmod +x ${PATCH_LOCATION}
|
chmod +x ${PATCH_LOCATION}
|
||||||
# run the patch
|
# run the patch
|
||||||
${PATCH_LOCATION}
|
${PATCH_LOCATION}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user