Fix #81, new env variable OPENVPN_ROOT
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
type OpenVPN struct {
|
||||
NetworkProtocol models.NetworkProtocol
|
||||
Verbosity int
|
||||
Root bool
|
||||
}
|
||||
|
||||
// GetOpenVPNSettings obtains the OpenVPN settings using the params functions
|
||||
@@ -24,14 +25,20 @@ func GetOpenVPNSettings(params params.ParamsReader) (settings OpenVPN, err error
|
||||
if err != nil {
|
||||
return settings, err
|
||||
}
|
||||
settings.Root, err = params.GetOpenVPNRoot()
|
||||
return settings, nil
|
||||
}
|
||||
|
||||
func (o *OpenVPN) String() string {
|
||||
runAsRoot := "no"
|
||||
if o.Root {
|
||||
runAsRoot = "yes"
|
||||
}
|
||||
settingsList := []string{
|
||||
"OpenVPN settings:",
|
||||
"Network protocol: " + string(o.NetworkProtocol),
|
||||
"Verbosity level: " + fmt.Sprintf("%d", o.Verbosity),
|
||||
"Run as root: " + runAsRoot,
|
||||
}
|
||||
return strings.Join(settingsList, "\n|--")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user