From 3b4626714ec3e0728da61b1f5ec3a75ed7075f1d Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sun, 12 May 2024 22:43:30 +0200 Subject: [PATCH 1/2] refactor: Remove unzip dependency tar is normally present on all linux distributions, so it is preferable to use it instead of unzip. --- rmmagent-linux.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/rmmagent-linux.sh b/rmmagent-linux.sh index dfe3f55..affbfb1 100644 --- a/rmmagent-linux.sh +++ b/rmmagent-linux.sh @@ -1,10 +1,4 @@ #!/bin/bash -check_zip=$(which unzip 2> /dev/null) -if [[ $check_zip == "" || $check_zip =~ .*"no unzip".* ]]; then - echo "unzip could not be found. Please install unzip." - exit 0 -fi - if [[ $1 == "" ]]; then echo "First argument is empty !" echo "Type help for more information" @@ -198,9 +192,9 @@ function go_install() { function agent_compile() { ## Compiling and installing tactical agent from github echo "Agent Compile begin" - wget -O /tmp/rmmagent.zip "https://github.com/amidaware/rmmagent/archive/refs/heads/master.zip" - unzip /tmp/rmmagent -d /tmp/ - rm /tmp/rmmagent.zip + wget -O /tmp/rmmagent.tar.gz "https://github.com/amidaware/rmmagent/archive/refs/heads/master.tar.gz" + tar -xf /tmp/rmmagent.tar.gz -C /tmp/ + rm /tmp/rmmagent.tar.gz cd /tmp/rmmagent-master case $system in amd64) From 6af2c5072ec4f49f57a4d8a593a6beb8ae370e9d Mon Sep 17 00:00:00 2001 From: MatMoul Date: Mon, 13 May 2024 19:20:52 +0200 Subject: [PATCH 2/2] refactor: Identation correction --- rmmagent-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmmagent-linux.sh b/rmmagent-linux.sh index affbfb1..ccb2694 100644 --- a/rmmagent-linux.sh +++ b/rmmagent-linux.sh @@ -192,7 +192,7 @@ function go_install() { function agent_compile() { ## Compiling and installing tactical agent from github echo "Agent Compile begin" - wget -O /tmp/rmmagent.tar.gz "https://github.com/amidaware/rmmagent/archive/refs/heads/master.tar.gz" + wget -O /tmp/rmmagent.tar.gz "https://github.com/amidaware/rmmagent/archive/refs/heads/master.tar.gz" tar -xf /tmp/rmmagent.tar.gz -C /tmp/ rm /tmp/rmmagent.tar.gz cd /tmp/rmmagent-master