From 432875eb518059f6e4e7fd039c12cd936d954fe1 Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Tue, 19 Dec 2023 14:30:19 +0100 Subject: [PATCH] =?utf8?q?Dostosowanie=20skrypt=C3=B3w=20addon=C3=B3w=20'n?= =?utf8?q?ushell'=20oraz=20'ncspot'=20do=20samodzielnej=20instalacji.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- addons/ncspot | 40 ++++++++++++--------------------- addons/nushell | 60 +++++++++++++++++++++++--------------------------- 2 files changed, 42 insertions(+), 58 deletions(-) diff --git a/addons/ncspot b/addons/ncspot index afc0a05..26e4779 100644 --- a/addons/ncspot +++ b/addons/ncspot @@ -3,36 +3,24 @@ if [ "$1" ]; then case $1 in "install") echo "Installation $(basename $0) addon..."; - if [ ! -d /usr/share/immudex-addons ]; then - mkdir /usr/share/immudex-addons; + VERSION="1.0.0"; + BETA=1; + if [ $BETA -eq 0 ]; then + TARBALL_URL="https://sourceforge.net/projects/immudex/files/immudex/software/ncspot/beta"; + else + TARBALL_URL="https://sourceforge.net/projects/immudex/files/immudex/software/ncspot"; fi - cat >> $(basename $0)_installer << EOF -VERSION="1.0.0"; -BETA=0; -if [ \$BETA -eq 0 ]; then -TARBALL_URL="https://sourceforge.net/projects/immudex/files/immudex/software/ncspot/beta"; -else -TARBALL_URL="https://sourceforge.net/projects/immudex/files/immudex/software/ncspot/"; -fi -ARCH="\$(uname -m)"; -if [ ! -x /usr/bin/curl ]; then apt install -y curl; fi -curl \${TARBALL}/ncspot-bin-\${VERSION}-\${ARCH}.tar.gz | tar -xzf - -C /usr/local/bin; -chmod +x /usr/local/bin/ncspot; -EOF - bash $(basename $0)_installer; - if [ $? -eq 0 ]; then - rm $(basename $0)_installer; - echo $(basename $0) | tee -a /usr/share/immudex-addons/installed-addons; + ARCH="$(uname -m)"; + wget ${TARBALL_URL}/ncspot-bin-${VERSION}-${ARCH}.tar.gz/download -O ncspot-bin-${VERSION}-${ARCH}.tar.gz; + tar -xzf ncspot-bin-${VERSION}-${ARCH}.tar.gz -C /usr/local/bin; + rm ncspot-bin-${VERSION}-${ARCH}.tar.gz; + chmod +x /usr/local/bin/ncspot; + if [ -x /usr/local/bin/ncspot ]; then echo "Installation $(basename $0) addon...[ OK ]"; fi;; "remove") echo "Removing $(basename $0) addon..."; - cat >> $(basename $0)_uninstaller << EOF -rm /usr/local/bin/ncspot; -EOF - bash $(basename $0)_uninstaller; - if [ $? -eq 0 ]; then - rm $(basename $0)_uninstaller; - sed -i "s/$(basename $0)//g" /usr/share/immudex-addons/installed-addons; + rm /usr/local/bin/ncspot; + if [ ! -f /usr/local/bin/ncspot ]; then echo "Removing $(basename $0) addon...[ OK ]"; fi;; esac diff --git a/addons/nushell b/addons/nushell index 4fa782c..da121ea 100644 --- a/addons/nushell +++ b/addons/nushell @@ -3,42 +3,38 @@ if [ "$1" ]; then case $1 in "install") echo "Installation $(basename $0) addon..."; - if [ ! -d /usr/share/immudex-addons ]; then - sudo mkdir /usr/share/immudex-addons; + VERSION="0.88.1"; + BETA="0"; + if [ $BETA -eq 0 ]; then + TARBALL_URL="https://sourceforge.net/projects/immudex/files/immudex/software/nushell/beta"; + else + TARBALL_URL="https://sourceforge.net/projects/immudex/files/immudex/software/nushell"; fi - cat >> $(basename $0)_installer << EOF -VERSION="0.87.1"; -ARCH="\$(uname -m)"; -if [ ! -x /usr/bin/curl ]; then apt install -y curl; fi -mkdir -p /usr/share/fonts/truetype/meslo; -curl -L https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/Meslo.tar.xz | tar -xJf - -C /usr/share/fonts/truetype/meslo; -curl https://ftp.morketsmerke.org/immudex/testing/addons/nu-bin-\${VERSION}-\${ARCH}.tar.gz | tar -xzf - -C /usr/local/bin; -chmod +x /usr/local/bin/nu; -wget https://ohmyposh.dev/install.sh -O /tmp/oh-my-posh-install.sh; -bash /tmp/oh-my-posh-install.sh; -rm /tmp/oh-my-posh-install.sh; -chmod +x /usr/local/bin/oh-my-posh; -mkdir /usr/share/oh-my-posh; -mv /root/.cache/oh-my-posh/themes /usr/share/oh-my-posh; -wget https://github.com/xf0r3m/immudex-testing/raw/main/files/immudex-nu.omp.json -O /usr/share/oh-my-posh/immudex-nu.omp.json; -EOF - bash $(basename $0)_installer; - if [ $? -eq 0 ]; then - rm $(basename $0)_installer; - echo $(basename $0) | sudo tee -a /usr/share/immudex-addons/installed-addons; + ARCH="$(uname -m)"; + mkdir -p /usr/share/fonts/truetype/meslo; + wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/Meslo.tar.xz; + tar -xJf Meslo.tar.xz -C /usr/share/fonts/truetype/meslo; + rm Meslo.tar.xz; + wget ${TARBALL_URL}/nu-bin-${VERSION}-${ARCH}.tar.gz; + tar -xzf nu-bin-${VERSION}-${ARCH}.tar.gz -C /usr/local/bin; + rm nu-bin-${VERSION}-${ARCH}.tar.gz; + chmod +x /usr/local/bin/nu; + wget https://ohmyposh.dev/install.sh -O /tmp/oh-my-posh-install.sh; + bash /tmp/oh-my-posh-install.sh; + rm /tmp/oh-my-posh-install.sh; + chmod +x /usr/local/bin/oh-my-posh; + mkdir /usr/share/oh-my-posh; + mv /root/.cache/oh-my-posh/themes /usr/share/oh-my-posh; + wget https://github.com/xf0r3m/immudex-testing/raw/main/files/immudex-nu.omp.json -O /usr/share/oh-my-posh/immudex-nu.omp.json; + if [ -x /usr/local/bin/nu ]; then echo "Installation $(basename $0) addon...[ OK ]"; fi;; "remove") echo "Removing $(basename $0) addon..."; - cat >> $(basename $0)_uninstaller << EOF -rm -rf /usr/share/fonts/truetype/meslo; -rm /usr/local/bin/nu; -rm /usr/local/bin/oh-my-posh; -rm -rf /usr/share/oh-my-posh; -EOF - bash $(basename $0)_uninstaller; - if [ $? -eq 0 ]; then - rm $(basename $0)_uninstaller; - sudo sed -i "s/$(basename $0)//g" /usr/share/immudex-addons/installed-addons; + rm -rf /usr/share/fonts/truetype/meslo; + rm /usr/local/bin/nu; + rm /usr/local/bin/oh-my-posh; + rm -rf /usr/share/oh-my-posh; + if [ ! -x /usr/local/bin/nu ]; then echo "Removing $(basename $0) addon...[ OK ]"; fi;; esac -- 2.39.5