File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env node
2+ 'use strict'
23try {
34 if ( process . argv [ 2 ] === '-install' ) {
45 var laCmd = process . mainModule . filename
2425 console . log ( 'Logagent service started' )
2526 } )
2627 svc . install ( )
27- }
28- if ( process . argv [ 2 ] === '-uninstall' ) {
28+ } else if ( process . argv [ 2 ] === '-uninstall' ) {
2929 let Service = require ( 'node-windows' ) . Service
3030 let svc = new Service ( {
3131 name : 'Logagent' ,
3737 } )
3838 svc . uninstall ( )
3939 } else {
40- process . argv . push ( '--config' )
41- process . argv . push ( process . env . LOGAGENT_CONFIG || process . env . ProgramData + '\\Sematext\\logagent.conf' )
40+ if ( process . argv . join ( ',' ) . indexOf ( '--config' ) === - 1 ) {
41+ // use default config
42+ process . argv . push ( '--config' )
43+ process . argv . push ( process . env . LOGAGENT_CONFIG || process . env . ProgramData + '\\Sematext\\logagent.conf' )
44+ }
4245 new ( require ( './logagent.js' ) ) ( )
4346 }
4447} catch ( err ) {
You can’t perform that action at this time.
0 commit comments