// ReadSpecFile reads the REX-Ray host address from the spec file. func ReadSpecFile() (string, error) { host, err := gotil.ReadFileToString(SpecFilePath()) if err != nil { return "", err } return gotil.Trim(host), nil }
// ReadPidFile reads the REX-Ray PID from the PID file. func ReadPidFile() (int, error) { pidStr, pidStrErr := gotil.ReadFileToString(PidFilePath()) if pidStrErr != nil { return -1, pidStrErr } pid, atoiErr := strconv.Atoi(pidStr) if atoiErr != nil { return -1, atoiErr } return pid, nil }