Changed update command handling

The update command did not prompt to specify the system type as an argument
This commit is contained in:
Adam Price 2023-06-03 15:07:14 +01:00 committed by GitHub
parent 260c1cb815
commit 791961bcb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,8 +14,8 @@ fi
if [[ $1 == "help" ]]; then if [[ $1 == "help" ]]; then
echo "There is help but more information is available at github.com/ZoLuSs/rmmagent-script" echo "There is help but more information is available at github.com/ZoLuSs/rmmagent-script"
echo "" echo ""
echo "List of INSTALL/UPDATE argument (no argument name):" echo "List of INSTALL argument (no argument name):"
echo "Arg 1: 'install' or 'update'" echo "Arg 1: 'install'"
echo "Arg 2: System type 'amd64' 'x86' 'arm64' 'armv6'" echo "Arg 2: System type 'amd64' 'x86' 'arm64' 'armv6'"
echo "Arg 3: Mesh agent URL" echo "Arg 3: Mesh agent URL"
echo "Arg 4: API URL" echo "Arg 4: API URL"
@ -24,13 +24,15 @@ if [[ $1 == "help" ]]; then
echo "Arg 7: Auth Key" echo "Arg 7: Auth Key"
echo "Arg 8: Agent Type 'server' or 'workstation'" echo "Arg 8: Agent Type 'server' or 'workstation'"
echo "" 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 "List of UNINSTALL argument (no argument name):"
echo "Arg 1: 'uninstall'" echo "Arg 1: 'uninstall'"
echo "Arg 2: Mesh agent FQDN (i.e. mesh.domain.com)" 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 "Arg 3: Mesh agent id (The id needs to have single quotes around it)"
echo "" echo ""
echo "Only argument 1 is needed for update"
echo ""
exit 0 exit 0
fi fi
@ -46,6 +48,13 @@ if [[ $1 == "install" && $2 == "" ]]; then
exit 1 exit 1
fi 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 if [[ $1 == "install" && $2 != "amd64" && $2 != "x86" && $2 != "arm64" && $2 != "armv6" ]]; then
echo "This argument can only be 'amd64' 'x86' 'arm64' 'armv6' !" echo "This argument can only be 'amd64' 'x86' 'arm64' 'armv6' !"
echo "Type help for more information" echo "Type help for more information"