From 8addafd4b90f60cd20417ae6381ebb5fb687132f Mon Sep 17 00:00:00 2001 From: Jeffrey Serio Date: Sun, 24 Nov 2024 06:18:57 -0600 Subject: [PATCH] Verify checksums OK --- install.sh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 4819ca9..01ea643 100755 --- a/install.sh +++ b/install.sh @@ -14,6 +14,7 @@ apt_packages=( calibre cmake curl + direnv duf emacs firewalld @@ -190,6 +191,7 @@ function install_packages() { sudo apt install -y "${apt_packages[@]}" install_makedeb_prebuilt_packages install_starship + install_zellij fi if test -f /etc/redhat-release; then @@ -228,15 +230,30 @@ function install_rpmfusion_packages() { sudo dnf install -y --allowerasing ffmpeg-libs } +install_zellij() { + if test -f /etc/debian_version; then + curl -s https://api.github.com/repos/zellij-org/zellij/releases/latest | grep "browser_download_url" | grep "zellij-$(uname -m)-unknown-linux-musl.tar.gz" | cut -d : -f 2,3 | tr -d '"' | wget -qi - + curl -s https://api.github.com/repos/zellij-org/zellij/releases/latest | grep "browser_download_url" | grep "zellij-$(uname -m)-unknown-linux-musl.sha256sum" | cut -d : -f 2,3 | tr -d '"' | wget -qi - + tar xvf "zellij-$(uname -m)-unknown-linux-musl.tar.gz" + if [ $(sha256sum -c "zellij-$(uname -m)-unknown-linux-musl.sha256sum" | head -n 1 | awk '{print $2}') = "OK" ]; then + sudo mv zellij /usr/local/bin + fi + rm -v zellij* + fi +} + function install_charm_packages() { action_label "INSTALLING CHARM PACKAGES" if test -f /etc/debian_version; then - ARCH=$(dpkg --print-architecture) - curl -s https://api.github.com/repos/charmbracelet/gum/releases/latest | grep "browser_download_url.*deb" | grep "$ARCH" | cut -d : -f 2,3 | tr -d '"' | wget -qi - - sudo dpkg -i gum*.deb - sudo apt -f install + curl -s https://api.github.com/repos/charmbracelet/gum/releases/latest | grep "browser_download_url.*deb" | grep "$(dpkg --print-architecture)" | cut -d : -f 2,3 | tr -d '"' | wget -qi - + curl -s https://api.github.com/repos/charmbracelet/gum/releases/latest | grep "browser_download_url" | grep "checksums.txt" | head -n 1 | cut -d : -f 2,3 | tr -d '"' | wget -qi - + if [ $(grep "$(dpkg --print-architecture).deb" checksums.txt | sha256sum -c | head -n 1 | awk '{print $2}') = "OK" ]; then + sudo dpkg -i gum*.deb + sudo apt -f install + fi rm -v gum* + rm -v checksums.txt fi if test -f /etc/redhat-release; then