Added root check for service install/uninstall

Bryan Roe committed Aug 3, 2020 at 11:07 UTC a3609728e0b4294792f654af7a245541ea2ca8fd
1 file changed +6
agents/meshinstall-linux.js
+6
@@ -68,6 +68,12 @@ else
68 if ((msh.InstallFlags & 1) == 1) { buttons.unshift("Connect"); }
69 if ((msh.InstallFlags & 2) == 2)
70 {
71 + if (!require('user-sessions').isRoot())
72 + {
73 + console.log('\n' + "Elevated permissions is required to install/uninstall the agent.");
74 + console.log("Please try again with sudo.");
75 + process.exit();
76 + }
77 if (s)
78 {
79 if (process.platform == 'darwin' || require('message-box').kdialog)