hotfix(vpn): fix vpn stop when down command is empty

This commit is contained in:
Quentin McGaw
2026-03-11 16:26:13 +00:00
parent ba9fcb5b89
commit efea169495
+6 -4
View File
@@ -13,10 +13,12 @@ func (l *Loop) cleanup() {
settings := l.GetSettings()
var err error
commandString := strings.ReplaceAll(*settings.DownCommand, "{{VPN_INTERFACE}}", getVPNInterface(settings))
err = l.cmder.RunAndLog(context.Background(), commandString, l.logger)
if err != nil {
l.logger.Error("failed to run VPN down command: " + err.Error())
if *settings.DownCommand != "" {
commandString := strings.ReplaceAll(*settings.DownCommand, "{{VPN_INTERFACE}}", getVPNInterface(settings))
err = l.cmder.RunAndLog(context.Background(), commandString, l.logger)
if err != nil {
l.logger.Error("failed to run VPN down command: " + err.Error())
}
}
for _, vpnPort := range l.vpnInputPorts {