diff --git a/agents/meshinstall-linux.sh b/agents/meshinstall-linux.sh index 2b256187..0a8fdd32 100644 --- a/agents/meshinstall-linux.sh +++ b/agents/meshinstall-linux.sh @@ -182,21 +182,27 @@ UninstallAgent() { if [ $starttype -eq 1 ] then # systemd - rm -f /sbin/meshcmd /lib/systemd/system/meshagent.service systemctl disable meshagent systemctl stop meshagent + rm -f /sbin/meshcmd /lib/systemd/system/meshagent.service + systemctl stop meshagentDiagnostic &> /dev/null + rm -f /lib/systemd/system/meshagentDiagnostic.service &> /dev/null else if [ $starttype -eq 3 ]; then # initd service meshagent stop update-rc.d -f meshagent remove rm -f /sbin/meshcmd /etc/init.d/meshagent + service meshagentDiagnostic stop &> /dev/null + rm -f /etc/init.d/meshagentDiagnostic &> /dev/null elif [ $starttype -eq 2 ]; then # upstart initctl stop meshagent rm -f /sbin/meshcmd rm -f /etc/init/meshagent.conf rm -f /etc/rc2.d/S20mesh /etc/rc3.d/S20mesh /etc/rc5.d/S20mesh + initctl stop meshagentDiagnostic &> /dev/null + rm -f /etc/init/meshagentDiagnostic.conf &> /dev/null fi fi @@ -205,6 +211,8 @@ UninstallAgent() { rm -rf $installpath/* rmdir $installpath fi + rm -rf /usr/local/mesh_services/meshagentDiagnostic &> /dev/null + rm -f /etc/cron.d/meshagentDiagnostic_periodicStart &> /dev/null echo "Agent uninstalled." } diff --git a/views/default.handlebars b/views/default.handlebars index 80c69ff2..545702e5 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2673,15 +2673,35 @@ var servername = serverinfo.name; if ((servername.indexOf('.') == -1) || ((features & 2) != 0)) { servername = window.location.hostname; } // If the server name is not set or it's in LAN-only mode, use the URL hostname as server name. - var noProxy = ((features & 0x2000) != 0)?'--no-proxy ':''; // Server asked that agent be installed to preferably not use a HTTP proxy. - if (serverinfo.https == true) { + if (serverinfo.https == true) + { var portStr = (serverinfo.port == 443)?'':(":" + serverinfo.port); - Q('agins_linux_area').value = "wget https://" + servername + portStr + "/meshagents?script=1 " + noProxy + "--no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh https://" + servername + portStr + " '" + meshid.split('/')[2] + "'\r\n"; - Q('agins_linux_area_un').value = "wget https://" + servername + portStr + "/meshagents?script=1 " + noProxy + "--no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n"; - } else { - var portStr = (serverinfo.port == 80)?'':(":" + serverinfo.port); - Q('agins_linux_area').value = "wget http://" + servername + portStr + "/meshagents?script=1 " + noProxy + "-O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh http://" + servername + portStr + " '" + meshid.split('/')[2] + "'\r\n"; - Q('agins_linux_area_un').value = "wget http://" + servername + portStr + "/meshagents?script=1 " + noProxy + "-O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n"; + if ((features & 0x2000) == 0) + { + Q('agins_linux_area').value = "(wget https://" + servername + portStr + "/meshagents?script=1 --no-check-certificate -O ./meshinstall.sh || wget https://" + servername + portStr + "/meshagents?script=1 --no-proxy --no-check-certificate -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh https://" + servername + portStr + " '" + meshid.split('/')[2] + "'\r\n"; + Q('agins_linux_area_un').value = "(wget https://" + servername + portStr + "/meshagents?script=1 --no-check-certificate -O ./meshinstall.sh || wget https://" + servername + portStr + "/meshagents?script=1 --no-proxy --no-check-certificate -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n"; + } + else + { + // Server asked that agent be installed to preferably not use a HTTP proxy. + Q('agins_linux_area').value = "wget https://" + servername + portStr + "/meshagents?script=1 --no-proxy --no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh https://" + servername + portStr + " '" + meshid.split('/')[2] + "'\r\n"; + Q('agins_linux_area_un').value = "wget https://" + servername + portStr + "/meshagents?script=1 --no-proxy --no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n"; + } + } + else + { + var portStr = (serverinfo.port == 80) ? '' : (":" + serverinfo.port); + if ((features & 0x2000) == 0) + { + Q('agins_linux_area').value = "(wget http://" + servername + portStr + "/meshagents?script=1 -O ./meshinstall.sh || wget http://" + servername + portStr + "/meshagents?script=1 --no-proxy -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh http://" + servername + portStr + " '" + meshid.split('/')[2] + "'\r\n"; + Q('agins_linux_area_un').value = "(wget http://" + servername + portStr + "/meshagents?script=1 -O ./meshinstall.sh || wget http://" + servername + portStr + "/meshagents?script=1 --no-proxy -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n"; + } + else + { + // Server asked that agent be installed to preferably not use a HTTP proxy. + Q('agins_linux_area').value = "wget http://" + servername + portStr + "/meshagents?script=1 --no-proxy -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh http://" + servername + portStr + " '" + meshid.split('/')[2] + "'\r\n"; + Q('agins_linux_area_un').value = "wget http://" + servername + portStr + "/meshagents?script=1 --no-proxy -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n"; + } } Q('aginsSelect').focus(); addAgentToMeshClick();