peer autostart vpn on startup
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
1e9e515e65
commit
fb314539eb
2 changed files with 4 additions and 7 deletions
|
@ -40,7 +40,8 @@ const (
|
|||
|
||||
// Peer is the non-node peer
|
||||
type Peer struct {
|
||||
cfg *heimdall.PeerConfig
|
||||
cfg *heimdall.PeerConfig
|
||||
currentVersion string
|
||||
}
|
||||
|
||||
// NewPeer returns a new peer
|
||||
|
|
|
@ -72,15 +72,11 @@ func (p *Peer) sync(ctx context.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
e, err := heimdall.HashConfig(wireguardConfigPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// if config has not change skip update
|
||||
if h == e {
|
||||
if h == p.currentVersion {
|
||||
return nil
|
||||
}
|
||||
p.currentVersion = h
|
||||
|
||||
logrus.Debugf("updating peer config to version %s", h)
|
||||
// update wireguard config
|
||||
|
|
Loading…
Reference in a new issue