Browse Source

Add check for nftables on daemon start.

cameronts 3 years ago
parent
commit
766084d6a3
1 changed files with 10 additions and 0 deletions
  1. 10 0
      netclient/functions/mqpublish.go

+ 10 - 0
netclient/functions/mqpublish.go

@@ -43,6 +43,16 @@ func checkin() {
 		var nodeCfg config.ClientConfig
 		var nodeCfg config.ClientConfig
 		nodeCfg.Network = network
 		nodeCfg.Network = network
 		nodeCfg.ReadConfig()
 		nodeCfg.ReadConfig()
+		// check for nftables present if on Linux
+		if ncutils.IsLinux() {
+			if ncutils.IsNFTablesPresent() {
+				nodeCfg.Node.IsNFTablesPresent = "yes"
+			} else {
+				nodeCfg.Node.IsNFTablesPresent = "no"
+			}
+		} else {
+			nodeCfg.Node.IsNFTablesPresent = "no"
+		}
 		if nodeCfg.Node.IsStatic != "yes" {
 		if nodeCfg.Node.IsStatic != "yes" {
 			extIP, err := ncutils.GetPublicIP()
 			extIP, err := ncutils.GetPublicIP()
 			if err != nil {
 			if err != nil {