]> gitweb.morketsmerke.org Git - immudex.git/commitdiff
Dostosowanie skryptów addonów 'nushell' oraz 'ncspot' do samodzielnej instalacji.
authorxf0r3m <jakubstasinski@protonmail.com>
Tue, 19 Dec 2023 13:30:19 +0000 (14:30 +0100)
committerxf0r3m <jakubstasinski@protonmail.com>
Tue, 19 Dec 2023 13:30:19 +0000 (14:30 +0100)
addons/ncspot
addons/nushell

index afc0a05d60b103c86b9da66d48462b04f3c610cf..26e4779dd3a65c5393b90870c44c5d58c4624846 100644 (file)
@@ -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
index 4fa782c36df2b4a0abcd5140cdb60fc9e8de19f6..da121ea40deb2f0beb985105e6d8c1523e19ebbc 100644 (file)
@@ -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