Added Linux ARM Linaro support, improved Linux install script.

This commit is contained in:
Ylian Saint-Hilaire 2018-11-08 15:42:02 -08:00
parent e102b21f29
commit 4ab3398910
11 changed files with 54 additions and 29 deletions

Binary file not shown.

BIN
agents/meshagent_arm-linaro Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -36,16 +36,23 @@ CheckInstallAgent() {
else
installpath="/usr/mesh"
fi
if [ $# -eq 2 ]
if [ $# -ge 2 ]
then
url=$1
meshid=$2
meshidlen=${#meshid}
if [ $meshidlen -eq 64 ]
then
# echo "Detecting computer type..."
machinetype=$( uname -m )
machineid=0
machinetype=$( uname -m )
# If we have 3 arguments...
if [ $# -ge 3 ]
then
# echo "Computer type is specified..."
machineid=$3
else
# echo "Detecting computer type..."
if [ $machinetype == 'x86_64' ] || [ $machinetype == 'amd64' ]
then
# Linux x86, 64 bit
@ -61,13 +68,16 @@ CheckInstallAgent() {
# RaspberryPi 1 (armv6l) or RaspberryPi 2/3 (armv7l)
machineid=25
fi
# TODO: Add more machine types, detect KVM support, etc.
# Add more machine types, detect KVM support... here.
fi
if [ $machineid -eq 0 ]
then
echo "Unsupported machine type: $machinetype, check with server administrator."
echo "Unsupported machine type: $machinetype."
else
DownloadAgent $url $meshid $machineid
fi
else
echo "MeshID is not correct, must be 64 characters long."
fi
@ -84,14 +94,29 @@ DownloadAgent() {
# Create folder
mkdir -p /usr/local/mesh
cd /usr/local/mesh
# echo "Downloading mesh agent..."
echo "Downloading Mesh agent #$machineid..."
wget $url/meshagents?id=$machineid -q --no-check-certificate -O /usr/local/mesh/meshagent
# If it did not work, try again using http
if [ $? != 0 ]
then
url=${url/"https://"/"http://"}
wget $url/meshagents?id=$machineid -q -O /usr/local/mesh/meshagent
fi
if [ $? -eq 0 ]
then
echo "Mesh agent downloaded."
# TODO: We could check the meshagent sha256 hash, but best to authenticate the server.
chmod 755 /usr/local/mesh/meshagent
wget $url/meshsettings?id=$meshid -q --no-check-certificate -O /usr/local/mesh/meshagent.msh
# If it did not work, try again using http
if [ $? -eq 0 ]
then
wget $url/meshsettings?id=$meshid -q -O /usr/local/mesh/meshagent.msh
fi
if [ $? -eq 0 ]
then
UpdateMshFile
@ -177,7 +202,7 @@ if [ $currentuser == 'root' ]
then
if [ $# -eq 0 ]
then
echo -e "This script will install or uninstall a mesh agent, usage:\n $0 [serverurl] [meshid]\n $0 uninstall"
echo -e "This script will install or uninstall a mesh agent, usage:\n $0 [serverurl] [meshid] (machineid)\n $0 uninstall"
else
if [ $# -eq 1 ]
then
@ -186,7 +211,7 @@ then
UninstallAgent
fi
else
CheckInstallAgent $1 $2
CheckInstallAgent $1 $2 $3
fi
fi
else

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.2.2-t",
"version": "0.2.2-u",
"keywords": [
"Remote Management",
"Intel AMT",