banner: build timestamp: read port from http-port.txt

This fixes the banner on devices that use a non-standard HTTP port
This commit is contained in:
Michael Stapelberg 2022-11-08 21:51:53 +01:00
parent 3d820b07fa
commit 2c1eed342d

View File

@ -123,7 +123,11 @@ func buildTimestamp() (string, error) {
if err != nil {
return "", err
}
req, err := http.NewRequest("GET", "http://gokrazy:"+strings.TrimSpace(string(pw))+"@localhost/", nil)
port, err := os.ReadFile("/etc/http-port.txt")
if err != nil {
return "", err
}
req, err := http.NewRequest("GET", "http://gokrazy:"+strings.TrimSpace(string(pw))+"@localhost:"+strings.TrimSpace(string(port))+"/", nil)
if err != nil {
return "", err
}