diff --git a/README.md b/README.md index cf5f1c2..3ef66c7 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Features - FileMaker Admin API PKI Authentication - View and change the settings for the persistent cache (for FileMaker Server 2024) - View and change the setting for blocking new users (for FileMaker Server 2024) +- View the setting for opening the databases that were opened when the database server was last shut down (for FileMaker Server 2024 (21.1)) Supported Servers ----- diff --git a/fmcsadmin.go b/fmcsadmin.go index 446f459..65336c8 100644 --- a/fmcsadmin.go +++ b/fmcsadmin.go @@ -1076,6 +1076,7 @@ func (c *cli) Run(args []string) int { case "authenticatedstream", "parallelbackupenabled": case "persistcacheenabled", "syncpersistcache", "databaseserverautorestart": case "blocknewusersenabled": + case "onlyopenlastopeneddatabases": default: exitStatus = 10001 } @@ -1130,6 +1131,8 @@ func (c *cli) Run(args []string) int { printOptions = append(printOptions, "databaseserverautorestart") case "blocknewusersenabled": printOptions = append(printOptions, "blocknewusersenabled") + case "onlyopenlastopeneddatabases": + printOptions = append(printOptions, "onlyopenlastopeneddatabases") default: exitStatus = 10001 } @@ -1158,6 +1161,9 @@ func (c *cli) Run(args []string) int { printOptions = append(printOptions, "databaseserverautorestart") printOptions = append(printOptions, "blocknewusersenabled") } + if !usingCloud && version >= 21.1 { + printOptions = append(printOptions, "onlyopenlastopeneddatabases") + } } if version >= 19.2 && startupRestoration { @@ -1220,6 +1226,18 @@ func (c *cli) Run(args []string) int { } } } + + if option == "onlyopenlastopeneddatabases" { + if usingCloud { + // for Claris FileMaker Cloud + exitStatus = 3 + } else { + // for Claris FileMaker Server + if version < 21.1 { + exitStatus = 3 + } + } + } } } @@ -3927,6 +3945,10 @@ func getServerGeneralConfigurations(urlString string, token string, printOptions var maxProConnections int var maxPSOS int var startupRestorationEnabled bool + var onlyOpenLastOpenedDatabases bool + + versionString, _ := getServerVersionString(strings.Replace(urlString, "/config/general", "/metadata", 1), token) + version, _ := getServerVersionAsFloat(versionString) body, _, err := callURL("GET", urlString, token, nil) if err != nil { @@ -3974,8 +3996,15 @@ func getServerGeneralConfigurations(urlString string, token string, printOptions settings = append(settings, -1) } - versionString, _ := getServerVersionString(strings.Replace(urlString, "/config/general", "/metadata", 1), token) - version, _ := getServerVersionAsFloat(versionString) + if version >= 21.1 { + // for Claris FileMaker Server 21.1.1 or later + _ = scan.ScanTree(v, "/response/onlyOpenLastOpenedDatabases", &onlyOpenLastOpenedDatabases) + if onlyOpenLastOpenedDatabases { + settings = append(settings, 1) + } else { + settings = append(settings, 0) + } + } // output if result == 0 { @@ -4050,6 +4079,16 @@ func getServerGeneralConfigurations(urlString string, token string, printOptions getServerSettingAsBool(strings.Replace(urlString, "/general", "/blocknewusers", 1), token, []string{option}) } } + + if option == "onlyopenlastopeneddatabases" { + if version >= 21.1 { + if onlyOpenLastOpenedDatabases { + fmt.Println("OnlyOpenLastOpenedDatabases = true [default: false] ") + } else { + fmt.Println("OnlyOpenLastOpenedDatabases = false [default: false] ") + } + } + } } } diff --git a/release-notes.txt b/release-notes.txt index a7f189d..6e19918 100644 --- a/release-notes.txt +++ b/release-notes.txt @@ -3,7 +3,9 @@ fmcsadmin This software is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information. Version: 2.3.0-dev (in development) +- Add support for Claris FileMaker Server 2024 (21.1). - Add support for macOS Sequoia 15. +- Update "GET SERVERPREFS" command to open the databases that were opened when the database server was last shut down for Claris FileMaker Server 2024 (21.1). (Usage: "fmcsadmin get serverprefs OnlyOpenLastOpenedDatabases") - Built with Go 1.23. - [INFO] Drop support for Claris FileMaker Server 19.6. - [INFO] Drop support for macOS Monterey 12.