From 1163217dc66c0d5c34ee69c045d8f4a5741fcb85 Mon Sep 17 00:00:00 2001 From: Vincentius Raynaldi <vincentius.raynaldi@stud.h-da.de> Date: Fri, 1 Nov 2024 18:28:52 +0100 Subject: [PATCH] changed the motd file path --- examples/example01/cmd/start.go | 1 + examples/example01/osclient/additions/system_linux.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/example01/cmd/start.go b/examples/example01/cmd/start.go index 88d5f00..359503f 100644 --- a/examples/example01/cmd/start.go +++ b/examples/example01/cmd/start.go @@ -87,6 +87,7 @@ var startCmd = &cobra.Command{ // The registered path handlers sorted by priority. If specific // handlers should be able to process their workload before others, // then they should be placed in the front of the slice. + fmt.Println("before handlers") handlers := []handler.PathHandler{ interfaces.NewInterfacesHandler(), networkinstances.NewNetworkInstanceHandler(), diff --git a/examples/example01/osclient/additions/system_linux.go b/examples/example01/osclient/additions/system_linux.go index 5d34802..eab5694 100644 --- a/examples/example01/osclient/additions/system_linux.go +++ b/examples/example01/osclient/additions/system_linux.go @@ -3,6 +3,7 @@ package additions import ( "bufio" "os" + "os/exec" "strings" "syscall" @@ -112,7 +113,9 @@ func (sys *system) GetSoftwareVersion() (string, error) { } func (sys *system) GetMotd() (string, error) { - motdMessage, err := os.ReadFile("/etc/motd") + cmd := exec.Command("run-parts", "/etc/update-motd.d/") + motdMessage, err := cmd.Output() + // motdMessage, err := os.ReadFile("/etc/motd") if err != nil { return "", err } -- GitLab