mirror of
https://github.com/luscis/openlan.git
synced 2025-10-08 10:00:12 +08:00
fea: support age timer for knock
This commit is contained in:
11
pkg/cache/openvpn.go
vendored
11
pkg/cache/openvpn.go
vendored
@@ -157,6 +157,17 @@ func (o *vpnClient) List(name string) <-chan *schema.VPNClient {
|
||||
return c
|
||||
}
|
||||
|
||||
func (o *vpnClient) Get(name, user string) *schema.VPNClient {
|
||||
username := user + "@" + name
|
||||
clients := o.readStatus(name)
|
||||
for _, client := range clients {
|
||||
if client.Name == username {
|
||||
return client
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *vpnClient) clientFile(name string) string {
|
||||
files, _ := filepath.Glob(o.Dir(name, "*client.ovpn"))
|
||||
if len(files) > 0 {
|
||||
|
Reference in New Issue
Block a user