Browse Source

added comms net default acl check

0xdcarns 3 years ago
parent
commit
d738a35eaf
1 changed files with 7 additions and 1 deletions
  1. 7 1
      serverctl/serverctl.go

+ 7 - 1
serverctl/serverctl.go

@@ -30,7 +30,7 @@ func InitializeCommsNetwork() error {
 
 	setCommsID()
 
-	_, err := logic.GetNetwork(COMMS_NETID)
+	commsNetwork, err := logic.GetNetwork(COMMS_NETID)
 	if err != nil {
 		var network models.Network
 		network.NetID = COMMS_NETID
@@ -42,6 +42,12 @@ func InitializeCommsNetwork() error {
 		_, err = logic.CreateNetwork(network)
 		return err
 	}
+	if commsNetwork.DefaultACL == "" {
+		commsNetwork.DefaultACL = "yes"
+		if err = logic.SaveNetwork(&commsNetwork); err != nil {
+			logger.Log(1, "comms net default acl is set incorrectly, please manually adjust to \"yes\",", COMMS_NETID)
+		}
+	}
 	time.Sleep(time.Second << 1)
 	SyncServerNetwork(COMMS_NETID)