func GetBMBridgeService(executable string) *service.Config {
	var arguments []string

	if executable != "" {
		// install mode
		ParseOptions(&opts)

		arguments = append(arguments, "--service")

		if opts.Password != "" {
			arguments = append(arguments, "--password="+opts.Password)
		}

		config.LoadBridgeConfig(opts.Config)
		arguments = append(arguments, "--config="+config.LoadedBridgeConfigPath)
	}

	// Get current user
	user, err := user.Current()
	if err != nil {
		return nil
	}

	svcConfig := getServiceConfig("BM-Bridge", "BitMaelum email bridge", "BitMaelum email bridge service", executable, arguments)

	if svcConfig == nil {
		return nil
	}

	if opts.UserName != "" {
		svcConfig.UserName = opts.UserName
	} else {
		svcConfig.UserName = user.Username
	}

	return svcConfig
}
// GetBMBridgeService will return the service info
GetBMBridgeService will return the service info
// GetBMBridgeService will return the service info
func GetBMBridgeService(executable string) *service.Config {
	var arguments []string
	if executable != "" {
		ParseOptions(&opts)
		arguments = append(arguments, "--service")
		if opts.Password != "" {
			arguments = append(arguments, "--password="+opts.Password)
		}
		config.LoadBridgeConfig(opts.Config)
		arguments = append(arguments, "--config="+config.LoadedBridgeConfigPath)
	}
	user, err := user.Current()
	if err != nil {
		return nil
	}
	svcConfig := getServiceConfig("BM-Bridge", "BitMaelum email bridge", "BitMaelum email bridge service", executable, arguments)
	if svcConfig == nil {
		return nil
	}
	if opts.UserName != "" {
		svcConfig.UserName = opts.UserName
	} else {
		svcConfig.UserName = user.Username
	}
	return svcConfig
}
func GetBMBridgeService ( executable string ) * service . Config { var arguments [ ] string if executable != " " { ParseOptions ( & opts ) arguments = append ( arguments , " " ) if opts . Password != " " { arguments = append ( arguments , " " + opts . Password ) } config . LoadBridgeConfig ( opts . Config ) arguments = append ( arguments , " " + config . LoadedBridgeConfigPath ) } user , err := user . Current ( ) if err != nil { return nil } svcConfig := getServiceConfig ( " " , " " , " " , executable , arguments ) if svcConfig == nil { return nil } if opts . UserName != " " { svcConfig . UserName = opts . UserName } else { svcConfig . UserName = user . Username } return svcConfig }
GetBMBridgeService will return the service info
GetBMBridgeService will return the service info
// install mode // Get current user