From: Roland Rosenfeld Date: Mon, 20 May 2024 16:39:32 +0200 Subject: Update MACHINE when MACHINEDOTS is set. According to xymonclient.cfg(5): MACHINEDOTS The hostname of the local system. Default: Taken from "uname -n". MACHINE The hostname of the local system, with dots replaced by commas. For compatibility with Big Brother extension scripts. --- a/lib/environ.c +++ b/lib/environ.c @@ -604,6 +604,12 @@ void loadenv(char *envfile, char *area) } putenv(oneenv); + if (strncmp(oneenv, "MACHINEDOTS=", 12) == 0) { + evar = (char *) malloc(strlen(oneenv)); + snprintf(evar, strlen(oneenv), "MACHINE=%s", commafy(oneenv+12)); + dbgprintf("Setting %s\n", evar); + putenv(evar); + } } } stackfclose(fd);