mirror of https://github.com/wb2osz/direwolf.git
Merge 51b780f325
into cf55b774e6
This commit is contained in:
commit
484fe2cbdf
6
beacon.c
6
beacon.c
|
@ -761,11 +761,13 @@ static void beacon_send (int j, dwgps_info_t *gpsinfo)
|
||||||
strlcat (super_comment, var_comment, sizeof(super_comment));
|
strlcat (super_comment, var_comment, sizeof(super_comment));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (k < 0 || !g_misc_config_p->beacon[j].ignore_empty_cmd_stdout) {
|
||||||
text_color_set(DW_COLOR_ERROR);
|
text_color_set(DW_COLOR_ERROR);
|
||||||
dw_printf ("xBEACON, config file line %d, COMMENTCMD failure.\n", g_misc_config_p->beacon[j].lineno);
|
dw_printf ("xBEACON, config file line %d, COMMENTCMD failure.\n", g_misc_config_p->beacon[j].lineno);
|
||||||
|
}
|
||||||
|
strlcpy (super_comment, "", sizeof(super_comment)); /* abort */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add the info part depending on beacon type.
|
* Add the info part depending on beacon type.
|
||||||
|
@ -882,8 +884,10 @@ static void beacon_send (int j, dwgps_info_t *gpsinfo)
|
||||||
strlcat (beacon_text, info_part, sizeof(beacon_text));
|
strlcat (beacon_text, info_part, sizeof(beacon_text));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if(k < 0 || !g_misc_config_p->beacon[j].ignore_empty_cmd_stdout) {
|
||||||
text_color_set(DW_COLOR_ERROR);
|
text_color_set(DW_COLOR_ERROR);
|
||||||
dw_printf ("CBEACON, config file line %d, INFOCMD failure.\n", g_misc_config_p->beacon[j].lineno);
|
dw_printf ("CBEACON, config file line %d, INFOCMD failure.\n", g_misc_config_p->beacon[j].lineno);
|
||||||
|
}
|
||||||
strlcpy (beacon_text, "", sizeof(beacon_text)); // abort!
|
strlcpy (beacon_text, "", sizeof(beacon_text)); // abort!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
3
config.c
3
config.c
|
@ -4831,6 +4831,9 @@ static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_
|
||||||
else if (strcasecmp(keyword, "INFOCMD") == 0) {
|
else if (strcasecmp(keyword, "INFOCMD") == 0) {
|
||||||
b->custom_infocmd = strdup(value);
|
b->custom_infocmd = strdup(value);
|
||||||
}
|
}
|
||||||
|
else if (strcasecmp(keyword, "IGNOREEMPTY") == 0) {
|
||||||
|
b->ignore_empty_cmd_stdout = atoi(value);
|
||||||
|
}
|
||||||
else if (strcasecmp(keyword, "OBJNAME") == 0) {
|
else if (strcasecmp(keyword, "OBJNAME") == 0) {
|
||||||
strlcpy(b->objname, value, sizeof(b->objname));
|
strlcpy(b->objname, value, sizeof(b->objname));
|
||||||
}
|
}
|
||||||
|
|
3
config.h
3
config.h
|
@ -176,7 +176,8 @@ struct misc_config_s {
|
||||||
char *comment; /* Comment or NULL. */
|
char *comment; /* Comment or NULL. */
|
||||||
char *commentcmd; /* Command to append more to Comment or NULL. */
|
char *commentcmd; /* Command to append more to Comment or NULL. */
|
||||||
|
|
||||||
|
int ignore_empty_cmd_stdout; /* Do not print an error when infocmd exits
|
||||||
|
with status 0, and no output is generated. */
|
||||||
} beacon[MAX_BEACONS];
|
} beacon[MAX_BEACONS];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue