From 791961bcb934fb2473c827c3767edb427d10fca8 Mon Sep 17 00:00:00 2001 From: Adam Price Date: Sat, 3 Jun 2023 15:07:14 +0100 Subject: [PATCH] Changed update command handling The update command did not prompt to specify the system type as an argument --- rmmagent-linux.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/rmmagent-linux.sh b/rmmagent-linux.sh index 48cc147..a6808fb 100644 --- a/rmmagent-linux.sh +++ b/rmmagent-linux.sh @@ -14,8 +14,8 @@ fi if [[ $1 == "help" ]]; then echo "There is help but more information is available at github.com/ZoLuSs/rmmagent-script" echo "" - echo "List of INSTALL/UPDATE argument (no argument name):" - echo "Arg 1: 'install' or 'update'" + echo "List of INSTALL argument (no argument name):" + echo "Arg 1: 'install'" echo "Arg 2: System type 'amd64' 'x86' 'arm64' 'armv6'" echo "Arg 3: Mesh agent URL" echo "Arg 4: API URL" @@ -24,13 +24,15 @@ if [[ $1 == "help" ]]; then echo "Arg 7: Auth Key" echo "Arg 8: Agent Type 'server' or 'workstation'" echo "" + echo "List of UPDATE argument (no argument name)" + echo "Arg 1: 'update'" + echo "Arg 2: System type 'amd64' 'x86' 'arm64' 'armv6'" + echo "" echo "List of UNINSTALL argument (no argument name):" echo "Arg 1: 'uninstall'" echo "Arg 2: Mesh agent FQDN (i.e. mesh.domain.com)" echo "Arg 3: Mesh agent id (The id needs to have single quotes around it)" echo "" - echo "Only argument 1 is needed for update" - echo "" exit 0 fi @@ -46,6 +48,13 @@ if [[ $1 == "install" && $2 == "" ]]; then exit 1 fi + +if [[ $1 == "update" && $2 == "" ]]; then + echo "Argument 2 (System type) is empty !" + echo "Type help for more information" + exit 1 +fi + if [[ $1 == "install" && $2 != "amd64" && $2 != "x86" && $2 != "arm64" && $2 != "armv6" ]]; then echo "This argument can only be 'amd64' 'x86' 'arm64' 'armv6' !" echo "Type help for more information"