#! /bin/sh
srv=`host -t srv _radsec._tcp.$1`
+# should do exit 1 or something if host command fails
host=`echo $srv|cut -d\ -f8`
port=`echo $srv|cut -d\ -f7`
echo "server $1-$host {"
}
void dynamicconfig(struct server *server) {
- int ok, fd[2];
+ int ok, fd[2], status;
pid_t pid;
struct clsrvconf *conf = server->conf;
struct gconffile *cf = NULL;
);
freegconf(&cf);
- if (waitpid(pid, NULL, 0) < 0) {
+ if (waitpid(pid, &status, 0) < 0) {
debug(DBG_ERR, "dynamicconfig: wait error");
goto errexit;
}
+
+ if (status) {
+ debug(DBG_INFO, "dynamicconfig: command exited with status %d", WEXITSTATUS(status));
+ goto errexit;
+ }
if (ok)
return;