Synced changes for silent install, with agent repo

Bryan Roe committed Oct 24, 2022 at 11:33 UTC 2b04eebcabc87926266d33cc9d0e7ceafaca742a
1 file changed +14 -17
agents/meshinstall-linux.js
+14 -17
@@ -222,21 +222,19 @@ if ((!skip) && ((msh.InstallFlags & 2) == 2))
222
223 if (!skip)
224 {
225 - if (process.platform != 'darwin')
225 + if (process.argv.includes('-install') || process.argv.includes('-update'))
226 {
227 - if (process.argv.includes('-install') || process.argv.includes('-update'))
227 + var p = [];
228 + for (var i = 0; i < process.argv.length; ++i)
229 {
229 - var p = [];
230 - for (var i = 0; i < process.argv.length; ++i)
230 + if (process.argv[i].startsWith('--installPath='))
231 {
232 - if (process.argv[i].startsWith('--installPath='))
233 - {
234 - p.push('--installPath="' + process.argv[i].split('=').pop() + '"');
235 - }
236 - else if(process.argv[i].startsWith('--'))
237 - {
238 - p.push(process.argv[i]);
239 - }
232 + p.push('--installPath="' + process.argv[i].split('=').pop() + '"');
233 + }
234 + else if(process.argv[i].startsWith('--'))
235 + {
236 + p.push(process.argv[i]);
237 + }
238 }
239 _install(p);
240 process.exit();
@@ -274,12 +272,11 @@ if ((!skip) && ((msh.InstallFlags & 2) == 2))
272 process.exit();
273 }
274 }
275 + if (process.platform == 'darwin')
276 + {
277 + if (!require('user-sessions').isRoot()) { console.log('\n' + translation[lang].elevation); process.exit(); }
278 + }
279 }
278 - else
279 - {
280 - if (!require('user-sessions').isRoot()) { console.log('\n' + translation[lang].elevation); process.exit(); }
281 - }
282 -}
280
281
282 if (!skip)