Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ssid=your-wifi-network
- password=your-wifi-password
- amdgpu=amdgpu-install_6.1.60103-1_all.deb
- amdurl=https://repo.radeon.com/amdgpu-install/6.1.3/ubuntu/jammy/
- downfold=/home/kali/Downloads/
- amdfold=/home/kali/Downloads/amd-package/
- runscript=/media/kali/8480B72A80B7221A/hashcat/run.bs
- ### Check for internet
- wget -q --spider http://repo.radeon.com
- if [ $? -eq 0 ]; then
- printf "Connected to Radeon Repo, proceeding...\n"
- else
- printf "Failed to connected to Radeon Repo, attempting wifi connection."
- sudo nmcli dev wifi connect "$ssid" password "$password"
- wget -q --spider http://repo.radeon.com
- if [ $? -eq 0 ]; then
- printf "Connected to Radeon Repo, proceeding...\n"
- else
- printf "Wifi connection failed, check connectivity."
- exit
- fi
- fi
- ### Update the sources list
- printf "\nAdding radeon apt repositories.\n"
- sudo sed -i '/radeon/d' /etc/apt/sources.list
- echo "deb [trusted=yes] https://repo.radeon.com/amdgpu/6.1.2/ubuntu jammy main" | sudo tee -a /etc/apt/sources.list
- echo "deb [trusted=yes] https://repo.radeon.com/rocm/apt/6.1.2 jammy main" | sudo tee -a /etc/apt/sources.list
- sudo apt update
- ### Get the amd gpu drivers
- if test -f ${downfold}${amdgpu}; then
- printf "\nDrivers have already been downloading, removing the existing download\n"
- rm ${downfold}${amdgpu}
- fi
- printf "\nDownloading the amdgpu drivers\n"
- wget --directory-prefix=${downfold} ${amdurl}${amdgpu}
- ### Unpack the deb file
- if test -d ${amdfold}; then
- printf "\nUnpackaged .deb folder already exists, removing the existing one\n"
- rm -rf ${amdfold}
- fi
- printf "\nUnpacking the amd .deb file to modify it\n"
- dpkg -x ${downfold}${amdgpu} ${amdfold}
- ### Modify the install script to support kali
- printf "\nModifying the amdgpu-install script to allow an install on kali\n"
- find ${amdfold}usr/bin/amdgpu-install -type f -exec sed -i 's/ubuntu|linuxmint|debian/ubuntu|linuxmint|debian|kali/g' {} \;
- ### Prompt user and run install script
- printf "\nAbout to installing the amdgpu drivers, READ THIS:\n"
- printf "During the install, you will be prompted twice to restart some services, unselect the udisks2.service\n"
- read -p "Do you understand? [y]" -n 1 -r
- printf "\n"
- if [[ $REPLY =~ ^[Yy]$ ]]
- then
- sudo $amdfold/usr/bin/amdgpu-install --usecase=opencl --no-dkms
- sudo apt install radeontop
- fi
- ### Optionally, trigger script to start hashing job
- printf "\nTip: hashcat needs to be run as sudo to access the GPU\n"
- printf " Run radeontop in another terminal to confirm GPU is being utilized\n"
- read -p "Would you like to proceed with hashing? [y]" -n 1 -r
- printf "\n"
- if [[ $REPLY =~ ^[Yy]$ ]]
- then
- ${runscript}
- fi
Advertisement
Add Comment
Please, Sign In to add comment