瀏覽代碼

added comms net default acl check

0xdcarns 3 年之前
父節點
當前提交
4c7509b556
共有 1 個文件被更改,包括 7 次插入1 次删除
  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)