mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-11 15:03:20 -05:00
Added Linux ARM Linaro support, improved Linux install script.
This commit is contained in:
parent
046bc1e963
commit
00ebb38ca4
Binary file not shown.
BIN
agents/meshagent_arm-linaro
Normal file
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.
@ -36,16 +36,23 @@ CheckInstallAgent() {
|
|||||||
else
|
else
|
||||||
installpath="/usr/mesh"
|
installpath="/usr/mesh"
|
||||||
fi
|
fi
|
||||||
if [ $# -eq 2 ]
|
if [ $# -ge 2 ]
|
||||||
then
|
then
|
||||||
url=$1
|
url=$1
|
||||||
meshid=$2
|
meshid=$2
|
||||||
meshidlen=${#meshid}
|
meshidlen=${#meshid}
|
||||||
if [ $meshidlen -eq 64 ]
|
if [ $meshidlen -eq 64 ]
|
||||||
then
|
then
|
||||||
# echo "Detecting computer type..."
|
|
||||||
machinetype=$( uname -m )
|
|
||||||
machineid=0
|
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' ]
|
if [ $machinetype == 'x86_64' ] || [ $machinetype == 'amd64' ]
|
||||||
then
|
then
|
||||||
# Linux x86, 64 bit
|
# Linux x86, 64 bit
|
||||||
@ -61,13 +68,16 @@ CheckInstallAgent() {
|
|||||||
# RaspberryPi 1 (armv6l) or RaspberryPi 2/3 (armv7l)
|
# RaspberryPi 1 (armv6l) or RaspberryPi 2/3 (armv7l)
|
||||||
machineid=25
|
machineid=25
|
||||||
fi
|
fi
|
||||||
# TODO: Add more machine types, detect KVM support, etc.
|
# Add more machine types, detect KVM support... here.
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $machineid -eq 0 ]
|
if [ $machineid -eq 0 ]
|
||||||
then
|
then
|
||||||
echo "Unsupported machine type: $machinetype, check with server administrator."
|
echo "Unsupported machine type: $machinetype."
|
||||||
else
|
else
|
||||||
DownloadAgent $url $meshid $machineid
|
DownloadAgent $url $meshid $machineid
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "MeshID is not correct, must be 64 characters long."
|
echo "MeshID is not correct, must be 64 characters long."
|
||||||
fi
|
fi
|
||||||
@ -84,14 +94,29 @@ DownloadAgent() {
|
|||||||
# Create folder
|
# Create folder
|
||||||
mkdir -p /usr/local/mesh
|
mkdir -p /usr/local/mesh
|
||||||
cd /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
|
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 ]
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
echo "Mesh agent downloaded."
|
echo "Mesh agent downloaded."
|
||||||
# TODO: We could check the meshagent sha256 hash, but best to authenticate the server.
|
# TODO: We could check the meshagent sha256 hash, but best to authenticate the server.
|
||||||
chmod 755 /usr/local/mesh/meshagent
|
chmod 755 /usr/local/mesh/meshagent
|
||||||
wget $url/meshsettings?id=$meshid -q --no-check-certificate -O /usr/local/mesh/meshagent.msh
|
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 ]
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
UpdateMshFile
|
UpdateMshFile
|
||||||
@ -177,7 +202,7 @@ if [ $currentuser == 'root' ]
|
|||||||
then
|
then
|
||||||
if [ $# -eq 0 ]
|
if [ $# -eq 0 ]
|
||||||
then
|
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
|
else
|
||||||
if [ $# -eq 1 ]
|
if [ $# -eq 1 ]
|
||||||
then
|
then
|
||||||
@ -186,7 +211,7 @@ then
|
|||||||
UninstallAgent
|
UninstallAgent
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
CheckInstallAgent $1 $2
|
CheckInstallAgent $1 $2 $3
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "meshcentral",
|
"name": "meshcentral",
|
||||||
"version": "0.2.2-t",
|
"version": "0.2.2-u",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Remote Management",
|
"Remote Management",
|
||||||
"Intel AMT",
|
"Intel AMT",
|
||||||
|
Loading…
Reference in New Issue
Block a user