From d82eae7034e0de30b5d61294cdb78c3ad8c1bbda Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 13 Apr 2023 20:16:19 +0200 Subject: Automate /var/lib/ceres creation That way only the system user setup and ownership change has to be done by the packager / installer. --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 3cf6fa7..5f86d3d 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,8 @@ package main import ( "log" + "os" + "path/filepath" "text/template" ) @@ -11,6 +13,10 @@ var templates *template.Template func main() { log.Printf("Started Ceres recipe server.\n") config = GetRuntimeConfig() + err := os.Mkdir(filepath.Join(config.Data, "recipes"), 0750) + if err != nil && !os.IsExist(err) { + log.Fatal(err) + } templates = setupTemplates() runServer() } -- cgit v1.2.3-70-g09d2