From baedf5657e484db4d709ece5a19edc6f9025c2c3 Mon Sep 17 00:00:00 2001 From: LukeZGD Date: Thu, 12 May 2022 15:57:33 +0800 Subject: [PATCH] Better Debian detection Fixes Debian-based distros that show unsupported (tested on SparkyLinux, Neptune, LMDE) --- resources/depends.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/depends.sh b/resources/depends.sh index 33ebe60..987fd39 100755 --- a/resources/depends.sh +++ b/resources/depends.sh @@ -118,11 +118,21 @@ InstallDepends() { Input "Press Enter/Return to continue (or press Ctrl+C to cancel)" read -s fi + + if [[ -e /etc/debian_version ]]; then + DebianVer=$(cat /etc/debian_version) + if [[ $DebianVer == *"sid" ]]; then + DebianVer="sid" + else + DebianVer="$(echo $DebianVer | cut -c -2)" + fi + fi + if [[ $ID == "arch" || $ID_LIKE == "arch" || $ID == "artix" ]]; then sudo pacman -Sy --noconfirm --needed base-devel bsdiff curl libimobiledevice openssh python2 unzip usbutils zenity elif [[ -n $UBUNTU_CODENAME && $VERSION_ID == "2"* ]] || - [[ $VERSION == "11 (bullseye)" || $PRETTY_NAME == "Debian"*"sid" ]]; then + (( DebianVer >= 11 )) || [[ $DebianVer == "sid" ]]; then [[ -n $UBUNTU_CODENAME ]] && sudo add-apt-repository -y universe sudo apt update sudo apt install -y bsdiff curl git libimobiledevice6 openssh-client python2 unzip usbmuxd usbutils zenity