]> gitweb.morketsmerke.org Git - immudex.git/commitdiff
Dostosowanie addonu nvidiaLatest do nowych wymagań addonów.
authorxf0r3m <jakubstasinski@protonmail.com>
Tue, 2 Jan 2024 09:57:18 +0000 (10:57 +0100)
committerxf0r3m <jakubstasinski@protonmail.com>
Tue, 2 Jan 2024 09:57:18 +0000 (10:57 +0100)
addons/nvidiaLatest

index a592127cf462948fe065107fba898e18de52370e..799a25a6f4c967b43990167f457896561339d401 100644 (file)
@@ -1,43 +1,20 @@
 #!/bin/bash
 
-if [ "$1" ]; then
-  case $1 in
-    "install") echo "Installation $(basename $0) addon...";
-                if [ ! -f /proc/cpuinfo ]; then
-                  echo "There is no system interfaces! Nothing to do. Exiting...";
-                  exit 1;
-                else
-                if [ ! -d /boot ]; then
-                       mkdir /boot;
-                       apt purge linux-image* --purge -y;
-                       apt install linux-image-amd64 -y;
-                fi
-
-                  cp -vv /etc/apt/sources.list /etc/apt/sources.list.d/nvidia.list;
-                  sed -e 's/main/contrib non-free non-free-firmware/g' -i /etc/apt/sources.list.d/nvidia.list;
-                  apt update;
-                  apt install -y build-essential dkms linux-headers-\$(uname -r);
-                  apt install -y nvidia-detect;
-                  apt install -y nvidia-driver;
-                  if [ $? -eq 0 ]; then success=0; else; success=1; fi
-                fi
-                if [ $success -eq 0 ]; then
-                  echo "Installation $(basename $0) addon...[ OK ]";
-                fi;;
-    "remove") echo "Removing $(basename $0) addon...";
-                apt remove -y nvidia-driver nvidia-detect dkms linux-headers-\$(uname -r);
-                apt purge -y nvidia-*;
-                if [ $? -eq 0 ]; then success=0; else success=1; fi
-                rm /etc/apt/sources.list.d/nvidia.list;
-                apt update;
-                apt-get autoremove -y;
-                apt-get autoclean;
-                apt-get clean;
-                if [ $success -eq 0 ]; then
-                  echo "Removing $(basename $0) addon...[ OK ]";
-                fi;;
-  esac
-else
-  echo "Internal error: action must be given.";
+set -e
+if [ ! -f /proc/cpuinfo ]; then
+  echo "There is no system interfaces! Nothing to do. Exiting...";
   exit 1;
+else
+  if [ ! -d /boot ]; then
+           mkdir /boot;
+           apt purge linux-image* --purge -y;
+           apt install linux-image-amd64 -y;
+  fi
+
+  cp -vv /etc/apt/sources.list /etc/apt/sources.list.d/nvidia.list;
+  sed -e 's/main/contrib non-free non-free-firmware/g' -i /etc/apt/sources.list.d/nvidia.list;
+  apt update;
+  apt install -y build-essential dkms linux-headers-\$(uname -r);
+  apt install -y nvidia-detect;
+  apt install -y nvidia-driver;
 fi