feat(openvpn): add support for openvpn 2.6
This commit is contained in:
@@ -15,6 +15,7 @@ var ErrVersionUnknown = errors.New("OpenVPN version is unknown")
|
||||
|
||||
const (
|
||||
binOpenvpn25 = "openvpn2.5"
|
||||
binOpenvpn26 = "openvpn2.6"
|
||||
)
|
||||
|
||||
func start(ctx context.Context, starter command.Starter, version string, flags []string) (
|
||||
@@ -23,6 +24,8 @@ func start(ctx context.Context, starter command.Starter, version string, flags [
|
||||
switch version {
|
||||
case openvpn.Openvpn25:
|
||||
bin = binOpenvpn25
|
||||
case openvpn.Openvpn26:
|
||||
bin = binOpenvpn26
|
||||
default:
|
||||
return nil, nil, nil, fmt.Errorf("%w: %s", ErrVersionUnknown, version)
|
||||
}
|
||||
|
||||
@@ -12,6 +12,10 @@ func (c *Configurator) Version25(ctx context.Context) (version string, err error
|
||||
return c.version(ctx, binOpenvpn25)
|
||||
}
|
||||
|
||||
func (c *Configurator) Version26(ctx context.Context) (version string, err error) {
|
||||
return c.version(ctx, binOpenvpn26)
|
||||
}
|
||||
|
||||
var ErrVersionTooShort = errors.New("version output is too short")
|
||||
|
||||
func (c *Configurator) version(ctx context.Context, binName string) (version string, err error) {
|
||||
|
||||
Reference in New Issue
Block a user